Skip site navigation (1) Skip section navigation (2)

Re: Re: [GENERAL] Re: temp table creation

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
Cc: Alfonso Peniche <alfonso(at)iteso(dot)mx>, PostgreSQL-documentation <pgsql-docs(at)postgresql(dot)org>
Subject: Re: Re: [GENERAL] Re: temp table creation
Date: 2001-03-20 17:14:22
Message-ID: 11423.985108462@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-docspgsql-general
Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)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

In response to

Responses

pgsql-docs by date

Next:From: Peter EisentrautDate: 2001-03-20 18:02:22
Subject: Re: Re: [GENERAL] Re: temp table creation
Previous:From: Bruce MomjianDate: 2001-03-20 16:47:41
Subject: Re: [GENERAL] Re: temp table creation

pgsql-general by date

Next:From: Daniel J. KressinDate: 2001-03-20 17:16:42
Subject: sorting on inet type?
Previous:From: Bruce MomjianDate: 2001-03-20 16:47:41
Subject: Re: [GENERAL] Re: temp table creation

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group