From: Tom Lane <tgl@sss.pgh.pa.us>
To: Bruce Momjian <pgman@candle.pha.pa.us>
Cc: Alfonso Peniche <alfonso@iteso.mx>
Cc: PostgreSQL-documentation <pgsql-docs@postgresql.org>
Subject: Re: Re: [GENERAL] Re: temp table creation
Date: Tue, 20 Mar 2001 12:14:22 -0500
Message-ID: <11423.985108462@sss.pgh.pa.us> (raw)
In-Reply-To: <200103201647.LAA00999@candle.pha.pa.us>
References: <200103201647.LAA00999@candle.pha.pa.us>
Bruce Momjian <pgman@candle.pha.pa.us> 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
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-docs@postgresql.org
Cc: tgl@sss.pgh.pa.us, pgman@candle.pha.pa.us, alfonso@iteso.mx
Subject: Re: Re: [GENERAL] Re: temp table creation
In-Reply-To: <11423.985108462@sss.pgh.pa.us>
* 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