Re: Document aggregate functions better w.r.t. ORDER BY

2023-11-03 Thread Bruce Momjian
On Thu, Oct 26, 2023 at 04:05:12PM -0700, David G. Johnston wrote: > On Thu, Oct 26, 2023 at 4:03 PM Bruce Momjian wrote: > > > Sure, done in the attached patch. > > > > WFM.  Thank You! Patch applied to master. -- Bruce Momjian https://momjian.us EDB

Re: Document aggregate functions better w.r.t. ORDER BY

2023-10-26 Thread David G. Johnston
On Thu, Oct 26, 2023 at 4:03 PM Bruce Momjian wrote: > > Sure, done in the attached patch. > > WFM. Thank You! David J.

Re: Document aggregate functions better w.r.t. ORDER BY

2023-10-26 Thread Bruce Momjian
On Thu, Oct 26, 2023 at 03:44:14PM -0700, David G. Johnston wrote: > On Thu, Oct 26, 2023 at 3:36 PM Bruce Momjian wrote: > > No sneaking.  ;-)  It would be bad to document this unevenly because it > sets expectations in other parts of the system if we don't mention it. > > > Agreed. >

Re: Document aggregate functions better w.r.t. ORDER BY

2023-10-26 Thread David G. Johnston
On Thu, Oct 26, 2023 at 3:36 PM Bruce Momjian wrote: > No sneaking. ;-) It would be bad to document this unevenly because it > sets expectations in other parts of the system if we don't mention it. > Agreed. Last suggestion, remove the first jsonb_agg example that lacks an order by. +WITH va

Re: Document aggregate functions better w.r.t. ORDER BY

2023-10-26 Thread Bruce Momjian
On Thu, Oct 26, 2023 at 03:09:26PM -0700, David G. Johnston wrote: > On Thu, Oct 26, 2023 at 2:56 PM Bruce Momjian wrote: > > On Wed, Oct 25, 2023 at 10:34:10PM -0700, David G. Johnston wrote: > > I would reword the existing note to be something like: > > > > The SQL Standard defi

Re: Document aggregate functions better w.r.t. ORDER BY

2023-10-26 Thread David G. Johnston
On Thu, Oct 26, 2023 at 2:56 PM Bruce Momjian wrote: > On Wed, Oct 25, 2023 at 10:34:10PM -0700, David G. Johnston wrote: > > I would reword the existing note to be something like: > > > > The SQL Standard defines specific aggregates and their properties, > including > > which of DISTINCT and/or

Re: Document aggregate functions better w.r.t. ORDER BY

2023-10-26 Thread Bruce Momjian
On Wed, Oct 25, 2023 at 10:34:10PM -0700, David G. Johnston wrote: > I would reword the existing note to be something like: > > The SQL Standard defines specific aggregates and their properties, including > which of DISTINCT and/or ORDER BY is allowed.  Due to the extensible nature of > PostgreSQL

Re: Document aggregate functions better w.r.t. ORDER BY

2023-10-25 Thread David G. Johnston
On Wed, Oct 25, 2023 at 7:13 PM David Rowley wrote: > On Thu, 26 Oct 2023 at 13:10, David G. Johnston > wrote: > > Question: Do you know whether we for certain always sort ascending here > to compute the unique values or whether if, say, there is an index on the > column in descending order (or

Re: Document aggregate functions better w.r.t. ORDER BY

2023-10-25 Thread David Rowley
On Thu, 26 Oct 2023 at 13:10, David G. Johnston wrote: > Question: Do you know whether we for certain always sort ascending here to > compute the unique values or whether if, say, there is an index on the column > in descending order (or ascending and traversed backwards) that the data > within

Re: Document aggregate functions better w.r.t. ORDER BY

2023-10-25 Thread Bruce Momjian
On Wed, Oct 25, 2023 at 05:10:17PM -0700, David G. Johnston wrote: > The paragraph leading into the last added example needs to be tweaked: > > If DISTINCT is specified within an aggregate, the data is sorted in ascending > order while extracting unique values.  You can add an ORDER BY clause, lim

Re: Document aggregate functions better w.r.t. ORDER BY

2023-10-25 Thread David G. Johnston
On Wed, Oct 25, 2023 at 4:22 PM Bruce Momjian wrote: > On Wed, Oct 25, 2023 at 04:14:11PM -0700, David G. Johnston wrote: > > Yeah, we punt on the entire concept in the data type section: > > > > "Managing these errors and how they propagate through calculations is the > > subject of an entire br

Re: Document aggregate functions better w.r.t. ORDER BY

2023-10-25 Thread Bruce Momjian
On Wed, Oct 25, 2023 at 04:14:11PM -0700, David G. Johnston wrote: > Yeah, we punt on the entire concept in the data type section: > > "Managing these errors and how they propagate through calculations is the > subject of an entire branch of mathematics and computer science and will not > be > di

Re: Document aggregate functions better w.r.t. ORDER BY

2023-10-25 Thread David G. Johnston
On Wed, Oct 25, 2023 at 8:36 AM Bruce Momjian wrote: > On Tue, Oct 24, 2023 at 06:45:48PM -0700, David G. Johnston wrote: > > I'd prefer to keep pointing out that the ones documented are those whose > > outputs will vary due to ordering. > > Okay, I re-added it in the attached patch, and tightene

Re: Document aggregate functions better w.r.t. ORDER BY

2023-10-25 Thread Bruce Momjian
On Tue, Oct 24, 2023 at 06:45:48PM -0700, David G. Johnston wrote: > I'd prefer to keep pointing out that the ones documented are those whose > outputs will vary due to ordering. Okay, I re-added it in the attached patch, and tightened up the text. > I've been sympathetic to the user comments tha

Re: Document aggregate functions better w.r.t. ORDER BY

2023-10-24 Thread David G. Johnston
On Tue, Oct 24, 2023 at 1:39 PM Bruce Momjian wrote: > On Tue, Dec 13, 2022 at 07:38:15PM -0700, David G. Johnston wrote: > > All, > > > > The recent discussion surrounding aggregates and ORDER BY moved me to > look over > > our existing documentation, especially now that we've reworked the > fun

Re: Document aggregate functions better w.r.t. ORDER BY

2023-10-24 Thread Bruce Momjian
On Tue, Dec 13, 2022 at 07:38:15PM -0700, David G. Johnston wrote: > All, > > The recent discussion surrounding aggregates and ORDER BY moved me to look > over > our existing documentation, especially now that we've reworked the function > tables, to see what improvements can be had by simply doc