CREATE TEMP TABLE AS ... ON COMMIT DROP fails

From: "Andrus Moor" <eetasoft(at)online(dot)ee>
To: pgsql-general(at)postgresql(dot)org
Subject: CREATE TEMP TABLE AS ... ON COMMIT DROP fails
Date: 2005-11-06 21:03:43
Message-ID: dklr9g$781$2@news.hub.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

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 ?

Andrus.

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Bob Pawley 2005-11-06 21:19:55 Subqueries
Previous Message Andrus Moor 2005-11-06 21:03:01 Best way to use indexes for partial match at beginning