Re: SELECT INTO TEMPORARY problem

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: David Goodenough <david(dot)goodenough(at)btconnect(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: SELECT INTO TEMPORARY problem
Date: 2007-01-17 16:48:37
Message-ID: 22611.1169052517@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

David Goodenough <david(dot)goodenough(at)btconnect(dot)com> writes:
> In one of the requests I do a SELECT ... INTO TEMPORARY t1 ..., which
> works just fine when I first use it, but from then on it objects saying
> that t1 already exists. When I read the documentation (8.1 as that is
> what I am using) I thought I understood that the table would disappear
> at the end of the transaction.

No, the default is to last until end of session.

There's an ON COMMIT DROP option in the CREATE TEMP TABLE syntax,
but I don't think it's possible to stick it into an INTO TEMP clause.

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2007-01-17 16:56:14 Re: Index bloat of 4x
Previous Message Csaba Nagy 2007-01-17 16:48:15 Re: Index bloat of 4x