Re: syntax error WITH ORDINALITY - Mailing list pgsql-bugs

From Tom Lane
Subject Re: syntax error WITH ORDINALITY
Date
Msg-id 20243.1406136212@sss.pgh.pa.us
Whole thread Raw
In response to syntax error WITH ORDINALITY  (Simon Riggs <simon@2ndQuadrant.com>)
Responses Re: syntax error WITH ORDINALITY  (Simon Riggs <simon@2ndQuadrant.com>)
List pgsql-bugs
Simon Riggs <simon@2ndQuadrant.com> writes:
> 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;

This is not a bug.  The WITH ORDINALITY option is only available in FROM.
I don't see any place in the documentation that suggests otherwise.

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

Indeed.

            regards, tom lane

pgsql-bugs by date:

Previous
From: Simon Riggs
Date:
Subject: syntax error WITH ORDINALITY
Next
From: fleminra@gmail.com
Date:
Subject: BUG #11028: psql doesn't use 0x01 and 0x02 to inform readline of non-printable PROMPT1 chars