Thread: Re: [BUGS] 7.2 crash...

Re: [BUGS] 7.2 crash...

From
Tom Lane
Date:
"Rod Taylor" <rbt@zort.ca> writes:
> 7.2 crashes with the below function:

> CREATE OR REPLACE FUNCTION runMaintenance()
> RETURNS BOOL AS '
>   VACUUM;
>   SELECT TRUE;
> ' LANGUAGE sql;

Ugh.  The problem is that VACUUM's implicit CommitTransaction calls
wipe out all the transient memory allocated by the function evaluation.
I don't see any reasonable way to support VACUUM inside a function
call; I think we have to prohibit it.

Unfortunately I don't see any clean way to test for this situation
either.  VACUUM's IsTransactionBlock() test obviously doesn't get the
job done.  Any ideas how to catch this?
        regards, tom lane