Re: min/max aggregation for jsonb

From: David Rowley <dgrowleyml(at)gmail(dot)com>
To: Daneel Yaitskov <dyaitskov(at)gmail(dot)com>
Cc: pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: min/max aggregation for jsonb
Date: 2023-03-03 10:41:46
Message-ID: CAApHDvr=fbq6B1Ohda670V-Bg+5iyeu6etzj2F0pTk0i=m4MRQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, 3 Mar 2023 at 23:17, Daneel Yaitskov <dyaitskov(at)gmail(dot)com> wrote:
> I wanted to use min/max aggregation functions for jsonb type and noticed
> there is no functions for this type, meanwhile string/array types are supported.

It's not really clear to me how you'd want these to sort. If you just
want to sort by what the output that you see from the type's output
function then you might get what you need by casting to text.

> Is there a concern about implementing support for jsonb in min/max?

I imagine a lack of any meaningful way of comparing two jsonb values
to find out which is greater than the other is of some concern.

David

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Bharath Rupireddy 2023-03-03 10:43:23 Re: Deduplicate logicalrep_read_tuple()
Previous Message Amit Kapila 2023-03-03 10:34:56 Re: [PATCH] Use indexes on the subscriber when REPLICA IDENTITY is full on the publisher