Forum OpenACS Q&A: load-data-model problems

Collapse
Posted by mark rohn on
I've loaded the data model into postgres and the script runs ok. The
problem starts when I dump the data model back to the text file
"datafile.txt". I get thousands of errors. I've deleted the database
and tried reloading the model twice, but with the same result, more
errors. Any ideas?

Thanks in Advance
Mark

Collapse
Posted by Roberto Mello on
Dumping back? Do yu get any errors when you load the datamodel? Try using  "2> datamodel.txt" when loading the datamodel and then open it in an editor and see if you have errors.

If you do you probably forgot to edit your postgres.sql (if you are using RPMs or DEBs for PG you need the development packages) or didn't RTFM.

Collapse
Posted by mark rohn on
Yes I did RTFM, but I could have missed something, here is a list of steps that I've done so far.

1.) Downloaded and complied postgres 7.02 from the prostgres web site. Postgres is now up and running and I can create, remove and access tables/databases

2.) I've created a new user "nsadmin" under the postgres super-user and then loged on on as "nsadmin"

3.) The county/state/zip codes have been loaded using the following script "./load-geo-tables lux_fs1" with lux_fs1 being my database.

4.) Yes, I did edit the "load-data-model.sql" and commented out the line "i postgres65.sql".

5.) After entering "psql -f load-data-model.sql lux_fs1" the database creates the tables.

6.) Now dumping the database with the following line "psql -f load-data-model.sql lux_fs1 2> datamodel.txt". The following shows up in datamodel.txt

Any ideas
Thanks in advance
Mark

psql:postgres.sql:14: ERROR:  ProcedureCreate: procedure plpgsql_call_handler already exists with same arguments
psql:postgres.sql:18: ERROR:  Language plpgsql already exists
psql:postgres.sql:27: ERROR:  ProcedureCreate: procedure date_standardize already exists with same arguments
psql:postgres.sql:38: ERROR:  ProcedureCreate: procedure sysdate_standard already exists with same arguments
psql:postgres.sql:44: ERROR:  ProcedureCreate: procedure sysdate already exists with same arguments
psql:postgres.sql:52: ERROR:  Relation 'dual' already exists
psql:postgres.sql:61: ERROR:  ProcedureCreate: procedure trunc already exists with same arguments
psql:postgres.sql:71: ERROR:  ProcedureCreate: procedure trunc already exists with same arguments
psql:postgres.sql:81: ERROR:  ProcedureCreate: procedure last_day already exists with same arguments
psql:postgres.sql:102: ERROR:  ProcedureCreate: procedure to_date_from_julian already exists with same arguments
psql:postgres.sql:114: ERROR:  ProcedureCreate: procedure sign already exists with same arguments
psql:postgres.sql:125: ERROR:  ProcedureCreate: procedure sign already exists with same arguments
psql:postgres.sql:139: ERROR:  ProcedureCreate: procedure date_num_days already exists with same arguments
psql:postgres.sql:147: ERROR:  ProcedureCreate: procedure timespan_days already exists with same arguments
psql:postgres.sql:157: ERROR:  ProcedureCreate: procedure logical_negation already exists with same arguments
psql:postgres.sql:168: ERROR:  ProcedureCreate: procedure logical_negation already exists with same arguments
psql:postgres.sql:178: ERROR:  ProcedureCreate: procedure round already exists with same arguments
psql:postgres.sql:187: ERROR:  ProcedureCreate: procedure months_between already exists with same arguments

Many more errors after this

Collapse
Posted by Roberto Mello on
I see,

You are trying to create the same things again.

You only need EITHER "psql -f load-data-model.sql lux_fs1" OR "psql -f load-data-model.sql lux_fs1 2> datamodel.txt" not both.

Collapse
Posted by mark rohn on
Roberto, Thanks for your help it works perfectly!!!!!

Thanks
Mark