Forum OpenACS Q&A: Restoring a dumped PostgreSQL database dies on tree_ancestor_keys definition

I've been running a nightly pg_dump on an OpenACS 4.5 system running against PostgreSQL 7.2.  (pg_dump comes from PostgreSQL 7.3, and I know that this is a bad thing, but I don't believe that my problem stems from that.)  For a variety of reasons, including my ability to sleep at night, I've been trying to re-import the dumped data into PostgreSQL  on another system.

Unfortunately, the import hasn't gone well.  I've dumped the database with

pg_dump -O  -x  -d -U pgsql --host db openacs > /tmp/backup.sql

(I know that -d, which forces INSERT syntax, is slower than the default use of COPY.  But then I got lost of \N characters that appear to represent NULL, but which psql wasn't able to handle on the re-import.)

When I try to re-import, psql chokes on the definition of tree_ancestor_keys, which is a recursive function.  From reading the docs, I know that tree_ancestor_keys is defined in some clever-hackish way, but I'm wondering if there is any simple, useful, easy way for me to restore the system without resorting to similiar hacks.

Thanks for any and all assistance!

Hi Reuven,

Look at #7 on this doc.  This could help.

https://openacs.org/doc/misc/openacs-pg-migration.txt

Some old discussion about this in here

https://openacs.org/forums/message-view?message_id=31016

OT:  How can one use the old bboards on the old site?  I would like search on those as the new site uses OpenFTS and it still not as good as the old site.