Re: SELECT INTO TEMPORARY problem - Mailing list pgsql-general

From Jaime Casanova
Subject Re: SELECT INTO TEMPORARY problem
Date
Msg-id c2d9e70e0701181952ne795501tb0cad28394aad96b@mail.gmail.com
Whole thread Raw
In response to Re: SELECT INTO TEMPORARY problem  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-general
On 1/17/07, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> David Goodenough <david.goodenough@btconnect.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
>

IIRC, you can do it using CREATE TEMP TABLE t1 ON COMMIT DROP AS query
but i think this new in 8.2

why not extending this to SELECT INTO TEMP?

--
regards,
Jaime Casanova

"Programming today is a race between software engineers striving to
build bigger and better idiot-proof programs and the universe trying
to produce bigger and better idiots.
So far, the universe is winning."
                                       Richard Cook

pgsql-general by date:

Previous
From: Ron Peterson
Date:
Subject: octet string type contribution
Next
From: "A.M."
Date:
Subject: Re: PostgreSQL and embedded PC with Compact Flash?