CREATE TEMPORARY TABLE ON COMMIT DROP

From: Luis Sousa <llsousa(at)ualg(dot)pt>
To: "pgsql-sql(at)postgresql(dot)org" <Pgsql-sql(at)postgresql(dot)org>
Subject: CREATE TEMPORARY TABLE ON COMMIT DROP
Date: 2005-09-14 16:22:41
Message-ID: 43284E51.8000507@ualg.pt
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Hi all,

I'm tryng to write query that on commit drops the temporary table but
I'm doing someting wrong.

According do documentation, I can create a temporary table using this
syntax:
CREATE TEMP TABLE table_name AS SELECT * from table_select;
or I can create a table like this:
CREATE TEMP TABLE table_name (fld1 integer) ON COMMIT DROP;

But how can I create a table using a query and putting ON COMMIT DROP.
Putting this on the end of the first sentence (CREATE TEMP TABLE
table_name AS SELECT * from table_select ON COMMIT DROP;) gives the
ERROR: syntax error at or near "ON" at character 60.

Thanks in advance for you answers.
Luis Sousa

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Tom Lane 2005-09-14 17:08:04 Re: CREATE TEMPORARY TABLE ON COMMIT DROP
Previous Message Peter Eisentraut 2005-09-14 14:39:41 Re: What should this query match?