X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id E88DAD8EA6 for ; Wed, 14 Sep 2005 13:22:29 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 61955-06 for ; Wed, 14 Sep 2005 16:22:26 +0000 (GMT) Received: from smtp3.ualg.pt (unknown [193.136.224.6]) by svr1.postgresql.org (Postfix) with ESMTP id 5077DD8EB5 for ; Wed, 14 Sep 2005 13:22:24 -0300 (ADT) Received: from localhost (smtp3.ualg.pt [127.0.0.1]) by smtp3.ualg.pt (Postfix) with ESMTP id BFD481E012B for ; Wed, 14 Sep 2005 17:22:22 +0100 (WEST) Received: from smtp3.ualg.pt ([127.0.0.1]) by localhost (smtp3.ualg.pt [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 31231-07 for ; Wed, 14 Sep 2005 17:22:22 +0100 (WEST) Received: from [10.17.20.14] (raio.ualg.pt [10.17.20.14]) by smtp3.ualg.pt (Postfix) with ESMTP id 7DA3F1E0124 for ; Wed, 14 Sep 2005 17:22:22 +0100 (WEST) Message-ID: <43284E51.8000507@ualg.pt> Date: Wed, 14 Sep 2005 17:22:41 +0100 From: Luis Sousa User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.8) Gecko/20050831 Debian/1.7.8-1sarge2 X-Accept-Language: en-pt MIME-Version: 1.0 To: "pgsql-sql@postgresql.org" Subject: CREATE TEMPORARY TABLE ON COMMIT DROP Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: amavisd-new at ualg.pt X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.662 required=5 tests=[AWL=-0.430, FORGED_RCVD_HELO=0.05, SUBJ_ALL_CAPS=0.365, TO_ADDRESS_EQ_REAL=0.47, UPPERCASE_25_50=0.207] X-Spam-Level: X-Archive-Number: 200509/152 X-Sequence-Number: 22699 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