Better documentation for row_number() combined with set returning functions

From: Erik Tews <erik(at)datenzone(dot)de>
To: pgsql-docs(at)lists(dot)postgresql(dot)org
Subject: Better documentation for row_number() combined with set returning functions
Date: 2020-02-25 19:24:13
Message-ID: e5116f96a53b73c1f3dff05d35218d146e622262.camel@datenzone.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-docs

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

Responses

Browse pgsql-docs by date

  From Date Subject
Next Message Laurenz Albe 2020-02-26 14:03:19 Re: No docs for interaction of ON DELETE/UPDATE and permissions
Previous Message David Glasser 2020-02-25 18:30:56 Re: No docs for interaction of ON DELETE/UPDATE and permissions