From: | Bruce Momjian <bruce(at)momjian(dot)us> |
---|---|
To: | "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com> |
Cc: | David Rowley <dgrowleyml(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org> |
Subject: | Re: Document aggregate functions better w.r.t. ORDER BY |
Date: | 2023-10-26 23:03:03 |
Message-ID: | ZTrwJxA7GWMzXXpg@momjian.us |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
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 <bruce(at)momjian(dot)us> 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 vals (k, v) AS ( VALUES ('key0','1'), ('key1','3'), ('key1','2') )
> +SELECT jsonb_object_agg(k, v) FROM vals;
> + jsonb_object_agg
> +----------------------------
> + {"key0": "1", "key1": "2"}
> +
>
> We shouldn't write an example that relies on the rows being evaluated 1-2-3
> without specifying an order by clause.
Sure, done in the attached patch.
--
Bruce Momjian <bruce(at)momjian(dot)us> https://momjian.us
EDB https://enterprisedb.com
Only you can decide what is important to you.
Attachment | Content-Type | Size |
---|---|---|
agg_order.diff | text/x-diff | 6.0 KB |
From | Date | Subject | |
---|---|---|---|
Next Message | David G. Johnston | 2023-10-26 23:05:12 | Re: Document aggregate functions better w.r.t. ORDER BY |
Previous Message | Bruce Momjian | 2023-10-26 23:01:38 | Re: Document parameter count limit |