docs: WITH queries and VALUES

Поиск
Список
Период
Сортировка
Искать

docs: WITH queries and VALUES

От:
Magnus Hagander <magnus@hagander.net>
Дата:
The SELECT manpage has:

and with_query is:
   with_query_name [ ( column_name [, ...] ) ] AS ( select | insert |
update | delete )


Should that list that you can use values as well? Or is it something
we generally consider "wherever select works you can use values"?

(I ran into it because it's what comes up when you do \h WITH, so I
got the question of "why is values not supported for with". but it
is..)

-- 
 Magnus Hagander
 Me: http://www.hagander.net/
 Work: http://www.redpill-linpro.com/

Re: docs: WITH queries and VALUES

От:
Stephen Frost <sfrost@snowman.net>
Дата:
* Magnus Hagander (magnus@hagander.net) wrote:
>     with_query_name [ ( column_name [, ...] ) ] AS ( select | insert |
> update | delete )
> 
> 
> Should that list that you can use values as well? Or is it something
> we generally consider "wherever select works you can use values"?
> 
> (I ran into it because it's what comes up when you do \h WITH, so I
> got the question of "why is values not supported for with". but it
> is..)

TABLE also works there, and here:
[ { UNION | INTERSECT | EXCEPT } [ ALL | DISTINCT ] select ]

and here:
( select ) [ AS ] alias [ ( column_alias [, ...] ) ]

Not sure if it's worth fixing, just something I noticed.
Thanks,
	Stephen

Re: docs: WITH queries and VALUES

От:
Tom Lane <tgl@sss.pgh.pa.us>
Дата:
Stephen Frost  writes:
> * Magnus Hagander (magnus@hagander.net) wrote:
>> with_query_name [ ( column_name [, ...] ) ] AS ( select | insert |
>> update | delete )
>> Should that list that you can use values as well? Or is it something
>> we generally consider "wherever select works you can use values"?

> TABLE also works there, and here:

Well, "TABLE foo" is defined as a shorthand for "SELECT * FROM foo",
so ISTM it's not too surprising that you can use it wherever you
can use SELECT.  I'm not sure that people have a similar view of
VALUES though.  It might be worth adding VALUES to the WITH syntax.
		regards, tom lane

Re: docs: WITH queries and VALUES

От:
Peter Eisentraut <peter_e@gmx.net>
Дата:
On tor, 2012-04-12 at 11:59 +0200, Magnus Hagander wrote:
> The SELECT manpage has:
> 
> and with_query is:
> 
>     with_query_name [ ( column_name [, ...] ) ] AS ( select | insert |
> update | delete )
> 
> 
> Should that list that you can use values as well? Or is it something
> we generally consider "wherever select works you can use values"?

Added.


Re: docs: WITH queries and VALUES

От:
Magnus Hagander <magnus@hagander.net>
Дата:


On Apr 14, 2012 8:09 AM, "Peter Eisentraut" <peter_e@gmx.net> wrote:
>
> On tor, 2012-04-12 at 11:59 +0200, Magnus Hagander wrote:
> > The SELECT manpage has:
> >
> > and with_query is:
> >
> >     with_query_name [ ( column_name [, ...] ) ] AS ( select | insert |
> > update | delete )
> >
> >
> > Should that list that you can use values as well? Or is it something
> > we generally consider "wherever select works you can use values"?
>
> Added.
>
Thanks!

/Magnus

FAQ