This leads to assertion failure, on versions 8.3 onwards where plan cache invalidation was introduced:

postgres=# CREATE FUNCTION ttfunc() RETURNS VOID AS $$
begin
  PERFORM * FROM temptable;
END;
$$ LANGUAGE plpgsql;
CREATE FUNCTION
postgres=# begin;
BEGIN
postgres=# CREATE TEMPORARY TABLE temptable (id int4);
CREATE TABLE
postgres=# SELECT ttfunc();
 ttfunc
--------

(1 row)

postgres=# rollback;
ROLLBACK
postgres=# SELECT ttfunc();
server closed the connection unexpectedly
        This probably means the server terminated abnormally
        before or while processing the request.

TRAP: FailedAssertion("!(((bool) ((myTempNamespace) != ((Oid) 0))))", File: "namespace.c", Line: 2705)

PushOverrideSearchPath() assumes that if the temporary namespace existed when an override search path was memorized with GetOverrideSearchPath(), it must still exist. That's not true in the above example, rolling back the transaction that the temporary namespace was created in drops it.

--
  Heikki Linnakangas
  EnterpriseDB   http://www.enterprisedb.com

--
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs

Reply via email to