From: Tom Lane <tgl@sss.pgh.pa.us>
To: Simon Riggs <simon@2ndQuadrant.com>
Cc: pgsql-bugs <pgsql-bugs@postgresql.org>
Subject: Re: syntax error WITH ORDINALITY
Date: Wed, 23 Jul 2014 13:23:32 -0400
Message-ID: <20243.1406136212@sss.pgh.pa.us> (raw)
In-Reply-To: <CA+U5nMLE9joz_=kafA4nc_tqmSHqW500_=vsBxzYWcUi9Ky3QA@mail.gmail.com>
References: <CA+U5nMLE9joz_=kafA4nc_tqmSHqW500_=vsBxzYWcUi9Ky3QA@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-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
--
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-bugs@postgresql.org
Cc: tgl@sss.pgh.pa.us, simon@2ndQuadrant.com
Subject: Re: syntax error WITH ORDINALITY
In-Reply-To: <20243.1406136212@sss.pgh.pa.us>
References: <CA+U5nMLE9joz_=kafA4nc_tqmSHqW500_=vsBxzYWcUi9Ky3QA@mail.gmail.com> <20243.1406136212@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox