From: Erik Tews <erik@datenzone.de>
To: pgsql-docs@lists.postgresql.org
Subject: Better documentation for row_number() combined with set returning functions
Date: Tue, 25 Feb 2020 20:24:13 +0100
Message-ID: <e5116f96a53b73c1f3dff05d35218d146e622262.camel@datenzone.de> (raw)
Hi
The current documentation of Postgresql sounds like row_number() over
() can be used to number the rows returned by postgres. However, that
doesn't work when the query also uses set returning functions such as
json_array_elements. In this case, row_number() will be the same for
every element of the set.
I suggest to add a paragraph to the description of row_number() that
states that this is the behaviour and maybe also reference the "with
ordinality" feature that can be used instead.
Erik
Attachments:
signature.asc (application/pgp-signature, 487B) download
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 using the --to and --cc options:
reply via email
To: pgsql-docs@postgresql.org
Cc: erik@datenzone.de, pgsql-docs@lists.postgresql.org
Subject: Re: Better documentation for row_number() combined with set returning functions
In-Reply-To: <e5116f96a53b73c1f3dff05d35218d146e622262.camel@datenzone.de>
* 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