Gavin Sherry <[EMAIL PROTECTED]> writes:
> Is this intentional:

> template1=# values(1), (2);
>  column1
> ---------
>        1
>        2
> (2 rows)

You bet.  VALUES is parallel to SELECT in the SQL grammar, so AFAICS
it should be legal anywhere you can write SELECT.

The basic productions in the spec's grammar are respectively

         <query specification> ::=
              SELECT [ <set quantifier> ] <select list>
                <table expression>


         <table value constructor> ::=
              VALUES <row value expression list>

and both of them link into the rest of the grammar here:

         <simple table> ::=
                <query specification>
              | <table value constructor>
              | <explicit table>

There is no construct I can find in the spec grammar that allows
<query specification> but not <table value constructor>.  QED.

Try some stuff like
        WHERE foo IN (VALUES ...

                        regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 3: Have you checked our extensive FAQ?


Reply via email to