temp table problem

From: "Abbas" <abbas(dot)butt(at)enterprisedb(dot)com>
To: <pgsql-hackers(at)postgresql(dot)org>
Subject: temp table problem
Date: 2008-07-17 03:36:39
Message-ID: 1216265799.5509.2.camel@abbas-laptop
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2008-07-17 05:26:52 Re: avoid recasting text to tsvector when calculating selectivity
Previous Message Sushant Sinha 2008-07-17 03:01:46 small bug in hlCover