Re: syntax error WITH ORDINALITY

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Simon Riggs <simon(at)2ndQuadrant(dot)com>
Cc: pgsql-bugs <pgsql-bugs(at)postgresql(dot)org>
Subject: Re: syntax error WITH ORDINALITY
Date: 2014-07-23 17:23:32
Message-ID: 20243.1406136212@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Simon Riggs <simon(at)2ndQuadrant(dot)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

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message fleminra 2014-07-23 17:56:29 BUG #11028: psql doesn't use 0x01 and 0x02 to inform readline of non-printable PROMPT1 chars
Previous Message Simon Riggs 2014-07-23 17:12:16 syntax error WITH ORDINALITY