docs: WITH queries and VALUES

Started by Magnus Haganderalmost 14 years ago5 messages
#1Magnus 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/

#2Stephen Frost
sfrost@snowman.net
In reply to: Magnus Hagander (#1)
Re: docs: WITH queries and VALUES

* 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

#3Tom Lane
tgl@sss.pgh.pa.us
In reply to: Stephen Frost (#2)
Re: docs: WITH queries and VALUES

Stephen Frost <sfrost@snowman.net> 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

#4Peter Eisentraut
peter_e@gmx.net
In reply to: Magnus Hagander (#1)
Re: docs: WITH queries and VALUES

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.

#5Magnus Hagander
magnus@hagander.net
In reply to: Peter Eisentraut (#4)
Re: docs: WITH queries and VALUES

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