Thread: pg_restore issue..

pg_restore issue..

From
Chris Bowlby
Date:
Hi Guy's,

 I've noticed a glitch (or alteast it looks like a glitch) with pg_restore
when trying to loadup a tarred pgdump file. There are a few functions that
have been defined that are recursive, the function call's itself until a
case point is reached which will cause it to call the "non-recursive"
function and exit out normally.

 If I take this function and cut/paste it into a console I can get it to
work fine, meaning the function will be created. BUT if I use a pg_restore
(even if I'm re-ordering the functions) it will error out claiming that
the function in question is not there (because it's calling itself). I've
attempted to restore just the function, but the pg_restore "cleans" itself
due to the dump that was made so it removes the function before it tries
to re-create it.

 I can call pg_restore -P function name, and as long as I have it's own
pre-requesite functions (other then itself) in place it will work fine..
so it's very inconsistant :(..

 Anyone else run into this problem? and is there an easy solution to it?

 Chris Bowlby,
 -----------------------------------------------------
 Manager of Information and Technology.
 excalibur@hub.org
 www.hub.org
 1-902-542-3657
 -----------------------------------------------------


Re: pg_restore issue..

From
Tom Lane
Date:
Chris Bowlby <excalibur@hub.org> writes:
>  I've noticed a glitch (or alteast it looks like a glitch) with pg_restore
> when trying to loadup a tarred pgdump file. There are a few functions that
> have been defined that are recursive, the function call's itself until a
> case point is reached which will cause it to call the "non-recursive"
> function and exit out normally.

This is a SQL function I suppose?  Before 7.3 we didn't really support
recursive SQL functions, because the function body was checked before
the function was defined.  You'll have to do some hack like creating
the function with a dummy nonrecursive body and then CREATE OR REPLACE
to insert the desired body.  (I suppose you must have done something
along that line to make the function originally.)

            regards, tom lane