pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Luis Sousa <llsousa@ualg.pt>
To: pgsql-sql@postgresql.org <Pgsql-sql@postgresql.org>
Subject: CREATE TEMPORARY TABLE ON COMMIT DROP
Date: Wed, 14 Sep 2005 17:22:41 +0100
Message-ID: <43284E51.8000507@ualg.pt> (raw)

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



view thread (2+ messages)  latest in thread

Message-ID: <43284E51.8000507@ualg.pt>
Permalink:  ../43284E51.8000507@ualg.pt/
Also on:    postgresql.org/message-id/43284E51.8000507@ualg.pt

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: llsousa@ualg.pt
  Subject: Re: CREATE TEMPORARY TABLE ON COMMIT DROP
  In-Reply-To: <43284E51.8000507@ualg.pt>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

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