syntax error WITH ORDINALITY - Mailing list pgsql-bugs

From Simon Riggs
Subject syntax error WITH ORDINALITY
Date
Msg-id CA+U5nMLE9joz_=kafA4nc_tqmSHqW500_=vsBxzYWcUi9Ky3QA@mail.gmail.com
Whole thread Raw
Responses Re: syntax error WITH ORDINALITY
Re: syntax error WITH ORDINALITY
List pgsql-bugs
postgres=# select * from unnest(ARRAY[1,2,3]) with ordinality;

 unnest | ordinality
--------+------------
      1 |          1
      2 |          2
      3 |          3

postgres=# select unnest(ARRAY[1,2,3]) with ordinality;

ERROR:  syntax error at or near "ordinality"
LINE 1: select unnest(ARRAY[1,2,3]) with ordinality;

though this works

postgres=# select unnest(ARRAY[1,2,3]);

 unnest
--------
      1
      2
      3

The manual
http://www.postgresql.org/docs/devel/static/queries-table-expressions.html#QUERIES-TABLEFUNCTIONS
says
"Columns returned by table functions can be included in SELECT, JOIN,
or WHERE clauses in the same manner as columns of a table, view, or
subquery."
There is no qualification of that for WITH ORDINALITY, nor an example

So either the manual is wrong, or the syntax is.

Also, WITH ORDINALITY is not mentioned here...
http://www.postgresql.org/docs/devel/static/functions-array.html

--
 Simon Riggs                   http://www.2ndQuadrant.com/
 PostgreSQL Development, 24x7 Support, Training & Services

pgsql-bugs by date:

Previous
From: Marti Raudsepp
Date:
Subject: Re: BUG #10972: string_agg function incorrectly concatenating varying delimiter
Next
From: Tom Lane
Date:
Subject: Re: syntax error WITH ORDINALITY