Re: Error with temporary tables

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Claire McLister <mclister(at)zeesource(dot)net>
Cc: pgsql general list <pgsql-general(at)postgresql(dot)org>
Subject: Re: Error with temporary tables
Date: 2006-02-04 02:01:27
Message-ID: 200602040201.k1421RJ11791@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


Read the FAQ.

---------------------------------------------------------------------------

Claire McLister wrote:
> Hi,
>
> I'm using a pgsql function that begins by creating a temporary
> table, does some processing, and then drops the temporary table just
> before exiting. It has been working fine for a while now, but
> suddenly complains for some calls that "Relation with OID" does not
> exist, at the point when it is executing the DROP table command.
>
> The general scheme is as follows:
>
> CREATE FUNCTION Foo(Integer) AS
> '
> BEGIN
> CREATE Temporary Table Bar AS (a left outer join of two tables)
> Do processing
> DROP Table Bar;
> RETURN 1;
> END
> '
>
> This is for Postgresql version 7.4.8
>
> Can someone tell me what I'm doing wrong? Should I try to use 'ON
> COMMIT DROP' instead?
>
> Thanks
>
> Claire
>
> --
> Claire McLister mclister(at)zeesource(dot)net
> 1684 Nightingale Avenue Suite 201
> Sunnyvale, CA 94087 408-733-2737(fax)
>
> http://www.zeemaps.com
>
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 9: In versions below 8.0, the planner will ignore your desire to
> choose an index scan if your joining column's datatypes do not
> match
>

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2006-02-04 02:38:13 Re: Bug with sequences and WAL ?
Previous Message Bruce Momjian 2006-02-04 01:10:39 Re: [GENERAL] Problems building pg 8.1.1