See the FAQ entry about temp tables in function. Use EXECUTE.
---------------------------------------------------------------------------
Juris Krumins wrote:
>
> Hi everybody. I have a problem with my PostgreSQL DBMS.
> In serverl log file I periodicly have errors like:
>
> 2004-03-24 11:43:18 ERROR: Relation "tmp_table1" does not exist
> 2004-03-24 11:43:18 ERROR: Relation "tmp_table1" does not exist
> 2004-03-24 11:43:18 ERROR: Relation 'tmp_table1' already exists
> 2004-03-24 11:43:18 ERROR: Relation "tmp_table1" does not exist
> 2004-03-24 11:43:18 ERROR: Relation "tmp_table1" does not exist
>
> I figure out that this is connected with query I use in one of the
> function:
>
> CREATE TEMP TABLE tmp_table1 AS SELECT bla-bla-bla.
>
> The problem is that when I had no so many users I have rigth now
> everything was ok, but now I have quite more users, so this problem
> appeared. Function , which use this query, is used all over my web site,
> which is base on PostgreSQL.
>
> So anybody have any idea how to correct this or maybe I have to change my
> query. Any help would be appreciated.
>
> I'm using PostgreSQL 7.3.4
>
> Thanks a lot.
>
> ---------------------------(end of broadcast)---------------------------
> TIP 8: explain analyze is your friend
>
--
Bruce Momjian | http://candle.pha.pa.us
pgman@candle.pha.pa.us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073