pg.ddx.io pgsql-sql@postgresql.org mailing list archive
help / color / mirror / Atom feedCREATE TEMPORARY TABLE ON COMMIT DROP
2+ messages / 2 participants
[nested] [flat]
* CREATE TEMPORARY TABLE ON COMMIT DROP
@ 2005-09-14 16:22 Luis Sousa <llsousa@ualg.pt>
2005-09-14 17:08 ` Re: CREATE TEMPORARY TABLE ON COMMIT DROP Tom Lane <tgl@sss.pgh.pa.us>
0 siblings, 1 reply; 2+ messages in thread
From: Luis Sousa @ 2005-09-14 16:22 UTC (permalink / raw)
To: 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
^ permalink raw reply [nested|flat] 2+ messages in thread
* Re: CREATE TEMPORARY TABLE ON COMMIT DROP
2005-09-14 16:22 CREATE TEMPORARY TABLE ON COMMIT DROP Luis Sousa <llsousa@ualg.pt>
@ 2005-09-14 17:08 ` Tom Lane <tgl@sss.pgh.pa.us>
0 siblings, 0 replies; 2+ messages in thread
From: Tom Lane @ 2005-09-14 17:08 UTC (permalink / raw)
To: Luis Sousa <llsousa@ualg.pt>; +Cc: pgsql-sql
Luis Sousa <llsousa@ualg.pt> writes:
> But how can I create a table using a query and putting ON COMMIT DROP.
You can't. Use INSERT ... SELECT to fill the table, instead.
regards, tom lane
^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~2005-09-14 17:08 UTC | newest]
Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2005-09-14 16:22 CREATE TEMPORARY TABLE ON COMMIT DROP Luis Sousa <llsousa@ualg.pt>
2005-09-14 17:08 ` Tom Lane <tgl@sss.pgh.pa.us>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox