Received: from sss.pgh.pa.us (sss.pgh.pa.us [209.114.132.154]) by mail.postgresql.org (8.11.3/8.11.1) with ESMTP id f2KHEQN54297 for ; Tue, 20 Mar 2001 12:14:26 -0500 (EST) (envelope-from tgl@sss.pgh.pa.us) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.11.1/8.11.1) with ESMTP id f2KHEMt11426; Tue, 20 Mar 2001 12:14:22 -0500 (EST) To: Bruce Momjian cc: Alfonso Peniche , PostgreSQL-documentation Subject: Re: Re: [GENERAL] Re: temp table creation In-reply-to: <200103201647.LAA00999@candle.pha.pa.us> References: <200103201647.LAA00999@candle.pha.pa.us> Comments: In-reply-to Bruce Momjian message dated "Tue, 20 Mar 2001 11:47:41 -0500" Date: Tue, 20 Mar 2001 12:14:22 -0500 Message-ID: <11423.985108462@sss.pgh.pa.us> From: Tom Lane X-Archive-Number: 200103/107 X-Sequence-Number: 541 Bruce Momjian writes: >>>> This should be in the docs somewhere. Is it? Actually, I thought the question was not about whether CREATE TABLE AS is documented, but about the specific point of it being the thing to use for this purpose in plpgsql: >> In that case, how could I create a temporary table from plpgsql? > CREATE [TEMP] TABLE foo AS SELECT ... > This is equivalent to SELECT INTO [TEMP] foo in regular SQL, and > does not change meaning in plpgsql. I have been thinking that our plain-SQL "SELECT INTO table" construct should be deprecated (and maybe eventually removed), since it really doesn't have much to do with the SQL-standard meaning of SELECT INTO: the spec contemplates INTO as introducing a list of scalar variables to be assigned to. plpgsql and ecpg both use this meaning for SELECT INTO. Would anyone object if I add text to the SELECT INTO ref page that points this out, and recommends CREATE TABLE AS as the preferred syntax? regards, tom lane