Re: CREATE TEMP TABLE AS ... ON COMMIT DROP fails

From: ellis(at)spinics(dot)net (Rick)
To: pgsql-general(at)postgresql(dot)org
Subject: Re: CREATE TEMP TABLE AS ... ON COMMIT DROP fails
Date: 2005-11-06 21:33:19
Message-ID: 1131312799.334735@localhost.localdomain
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

In article <dklr9g$781$2(at)news(dot)hub(dot)org>, Andrus Moor <eetasoft(at)online(dot)ee> wrote:
>I need to create temporary table with data which is dropped at end of
>transaction.
>
>CREATE TABLE t1 ( c1 INTEGER ) ;
>INSERT INTO t1 VALUES (1);
>CREATE TEMP TABLE t2 AS SELECT * FROM t1 ON COMMIT DROP;
>
>Causes ERROR: syntax error at or near "ON" at character 104
>
>How to implement this ?

You can't just explicitly drop the table just before the commit?

--
http://yosemitenews.info/

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2005-11-06 22:36:35 Re: CREATE TEMP TABLE AS ... ON COMMIT DROP fails
Previous Message Bob Pawley 2005-11-06 21:19:55 Subqueries