postgreSQL errors

Discussions About MOSS (Myst Online Server Software)

Moderators: a'moaca', rarified

Post Reply
Rael
Member
Posts: 13
Joined: Thu Apr 07, 2011 3:31 pm

postgreSQL errors

Post by Rael »

Hey there!
I finally made it through the build and configuration process, and I am now having some trouble with the postgreSQL interaction.
I'm running postgres 9.0.3 and here's what I did:
- Create a user account called "moss"
- Make a pgsql/data folder in its home
- export PGDATA=/home/moss/pgsql/data
- initdb
- pg_ctl start
- Created a new database called "moss"
- cd to MOSS/postgresql directory
- Opened with text editor the moss.sql file and changed returns text to returns uuid as requested in the readme file
- sudo make
- sudo make install
- cd to /usr/share/postgresql/contrib
- psql -U moss -d moss -f /home/myuser/MOSS/postgresql/moss.sql
- pg_ctl stop
- pg_ctl start
- moss_backend

I have done all the sus that were necessary and ran moss from the appropriate folder, where all its files are located, just to exclude that kind of error.

And now, here's the moss_backend.log file

Code: Select all

1305057100.008030  INFO backend: Backend startup
1305057100.077113  WARN backend: SQL error in Call_initvault: ERROR:  function createage(unknown, unknown, unknown, unknown, uuid, unknown) does not exist
LINE 1: SELECT v_agenode FROM createage('Neighborhood', 'Bevin', 'DR...
                              ^
HINT:  No function matches the given name and argument types. You might need to add explicit type casts.
QUERY:  SELECT v_agenode FROM createage('Neighborhood', 'Bevin', 'DRC', '', uuid(), NULL)
CONTEXT:  PL/pgSQL function "initvault" line 151 at istruzione SQL

1305057100.077340 DEBUG backend: Quitting because of an error in init()

What went wrong?
Thanks for help
a'moaca'
Member
Posts: 163
Joined: Sat Dec 13, 2008 11:22 pm

Re: postgreSQL errors

Post by a'moaca' »

Rael wrote:- Opened with text editor the moss.sql file and changed returns text to returns uuid as requested in the readme file
Don't do this step. Hopefully that's all that's wrong.

Those instructions were written generally for the uuid module. The uuidgen code and corresponding instructions all predate the actual MOSS database code which uses text UUIDs. If you want to use uuid type UUIDs you will have to edit all the functions that use uuids in the DB. Not worth the trouble, I don't think. Also, I doubt the C++ code would handle the binary representation properly. You can use the moss.sql file unedited so long as your DB user is "moss".

I don't want to delete the only documentation on how to generate uuid-type UUIDs, so I guess I could edit the postgresql/README file to say that moss.sql uses text-style UUIDs.

If you want to fix it without tossing and reloading the DB, you can drop the uuid function and load the new version by copying in the unedited function. Something like:

Code: Select all

drop function uuid();
create function uuid() returns text as 'moss_uuidgen', 'moss_uuidgen_text' language c strict;
You will probably have to restart postgres. It does some funky function hashing and the easiest way to fix it is a restart.

Edit: actually it's probably easiest to drop the whole DB. I think there might some places UUIDs are created already and they will be of the wrong type. You don't have to restart anything that way either. :)

- a'moaca'
Rael
Member
Posts: 13
Joined: Thu Apr 07, 2011 3:31 pm

Re: postgreSQL errors

Post by Rael »

Alright, this time it worked.
I don't know why it did, though, because when I tried for the first time i didn't change the return type...
Well... Only God Knows It...

Thanks for help!
Post Reply

Return to “MOSS”