g.jalmi@tcs.com writes:
> PostgreSQL version: 9.1.14
> Scenario: A temporary table is created within a function where no schema
> name is specefied for the table. This table is created using dynamic sql.
> close the cursor
> return all records from temporary table and then drop the temorary
> table.
It's hard to be sure since you didn't provide a concrete test case, but
this sounds very much like a bug that was fixed last September (in 9.1.19
and its sibling releases); see
http://git.postgresql.org/gitweb/?p=postgresql.git&a=commitdiff&h=dae1c9480
If updating to 9.1.19 or 9.1.20 doesn't fix it, please provide an
exact script to reproduce the problem.
regards, tom lane