Re: dump contents & missing functions - Mailing list pgsql-admin

From Tom Lane
Subject Re: dump contents & missing functions
Date
Msg-id 10982.1072889767@sss.pgh.pa.us
Whole thread Raw
In response to dump contents & missing functions  (Kris Kiger <kris@musicrebellion.com>)
List pgsql-admin
Kris Kiger <kris@musicrebellion.com> writes:
> This whole issue arose when I set a default in a table row equal to a
> value that a plpgsql function returns (ie the table default =
> functionname(variable)).  However, after exploration of the dump files,
> it appears that pg_restore tries to restore the tables before it
> restores functions...hence I get an error upon restore of the original
> dump, because the function does not yet exist.  Does anyone know if the
> ordering of the restore is in fact the problem?  Any input is appreciated!

pg_restore has facilities for telling it to restore the dump contents in
a particular order (basically, get a table-of-contents listing and then
edit the listing).  I don't think it works to hack the tar file
directly.

Also you could try using development tip pg_dump, which should get the
dump order right to begin with.  AFAIK it will work okay with a 7.4
server.

            regards, tom lane

pgsql-admin by date:

Previous
From: Kenny Drobnack
Date:
Subject: forcing postgresql 7.3 to use crypt passwords
Next
From: Tom Lane
Date:
Subject: Re: forcing postgresql 7.3 to use crypt passwords