Re: BUG #15913: Could not open relation with oid on PL/pgSQL method referencing temporary table that got recreated

Tom Lane <tgl@sss.pgh.pa.us>

From: Tom Lane <tgl@sss.pgh.pa.us>
To: zeroimpl@gmail.com
Cc: pgsql-bugs@lists.postgresql.org
Date: 2019-08-15T19:23:31Z
Lists: pgsql-bugs
PG Bug reporting form <noreply@postgresql.org> writes:
> I have some SQL which works fine in 9.x and 10.x, but fails in 11.x and 12.x
> (I tested on various Docker images).
> One of the functions declares a variable whose type matches a temporary
> table. If I drop and recreate that temporary table twice in the same
> session, I get an error like: "ERROR:  could not open relation with OID
> xxx". This occurs on the second call to the DoSomething() function after the
> temporary table has been recreated. 

I've pushed a fix for this -

https://git.postgresql.org/gitweb/?p=postgresql.git;a=commitdiff;h=6070ccdd179f34efecc92d6679a141093df0f879

Thanks for the report!

			regards, tom lane



Commits

  1. Fix plpgsql to re-look-up composite type names at need.