Re: [PATCHES] [DOCS] Values list-of-targetlists patch for comments (was Re: - Mailing list pgsql-hackers

From Tom Lane
Subject Re: [PATCHES] [DOCS] Values list-of-targetlists patch for comments (was Re:
Date
Msg-id 27400.1155143250@sss.pgh.pa.us
Whole thread Raw
In response to Re: [PATCHES] [DOCS] Values list-of-targetlists patch for comments (was Re:  (David Fetter <david@fetter.org>)
List pgsql-hackers
David Fetter <david@fetter.org> writes:
> However, there are some oddities:
> postgres=# SELECT * FROM (VALUES (1,2)) AS foo(bar,baz);
> [ works ]
> postgres=# (VALUES (1,2)) AS foo(bar,baz);
> ERROR:  syntax error at or near "AS"

This is per spec.  Effectively, AS is part of the FROM-clause syntax
not part of a standalone command.  You can't write this either:

regression=# (select 1,2) as foo(bar,baz);
ERROR:  syntax error at or near "as"
LINE 1: (select 1,2) as foo(bar,baz);
                     ^

            regards, tom lane

pgsql-hackers by date:

Previous
From: "Joshua D. Drake"
Date:
Subject: Re: 8.2 features status
Next
From: Heikki Linnakangas
Date:
Subject: Re: 8.2 features status