syntax error WITH ORDINALITY

Поиск
Список
Период
Сортировка
От Simon Riggs
Тема syntax error WITH ORDINALITY
Дата
Msg-id CA+U5nMLE9joz_=kafA4nc_tqmSHqW500_=vsBxzYWcUi9Ky3QA@mail.gmail.com
обсуждение исходный текст
Ответы Re: syntax error WITH ORDINALITY  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: syntax error WITH ORDINALITY  (David G Johnston <david.g.johnston@gmail.com>)
Список 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 по дате отправления:

Предыдущее
От: Marti Raudsepp
Дата:
Сообщение: Re: BUG #10972: string_agg function incorrectly concatenating varying delimiter
Следующее
От: Tom Lane
Дата:
Сообщение: Re: syntax error WITH ORDINALITY