temp table problem - Mailing list pgsql-hackers

From Abbas
Subject temp table problem
Date
Msg-id 1216265799.5509.2.camel@abbas-laptop
Whole thread Raw
Responses Re: temp table problem
List pgsql-hackers
Hi,
I have come across a problem. When you try to access a temp table
created via SPI_EXEC, you get a table not found error.
 SPI_EXEC("CREATE TEMP TABLE my_temp_table(first_name text, last_name
text)", UTILITY); SPI_EXEC("REVOKE ALL ON TABLE my_temp_table FROM PUBLIC", UTILITY);

The second statement generates a table not found error, although the
first statement was successful.

After initdb the system has no temp namespace to hold
temp objects and hence the search path does not contain 
any temp namespace either.
On first call to create a temp table the system first creates
a temp namespace. At this point the system calls recomputeNamespacePath
thinking that it would update search path and include the temp namespace
in it, but that does not happen beccause of override search path stack.
Hence subsquent calls to say insert into the temp table fail.

Any suggestions on how to tackle this problem?

Regards
Abbas
EnterpriseDB   http://www.enterprisedb.com




pgsql-hackers by date:

Previous
From: daveg
Date:
Subject: Re: [PATCHES] pg_dump lock timeout
Next
From: Tom Lane
Date:
Subject: autovacuum crash due to null pointer