Re: proposal: jsonb_populate_array

From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: Erik Rijkers <er(at)xs4all(dot)nl>
Cc: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: proposal: jsonb_populate_array
Date: 2023-08-14 13:37:04
Message-ID: CAFj8pRCMm6LM7=ej=e7SBzzs7eGxV8TbvurPgwmDxX1mC844uQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

po 14. 8. 2023 v 15:09 odesílatel Erik Rijkers <er(at)xs4all(dot)nl> napsal:

> Op 8/14/23 om 14:51 schreef Pavel Stehule:> po 14. 8. 2023 v 11:32
> odesílatel Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
> > with proposed function I can write
> >
> > select jsonb_populate_array(null:date[],
> > '["2023-07-13","2023-07-14"]'::jsonb)
> >
> Not yet committed, but outstanding
> SQL/JSON patches (v11) will let you do:
>
> select json_query(
> '["2023-07-13", "2023-07-14"]'::jsonb
> , '$' returning date[]
> );
> json_query
> -------------------------
> {2023-07-13,2023-07-14}
> (1 row)
>
> That's (more or less) what you want, no?
>

Yes, the functionality is exactly the same, but still maybe for completeness
the function json_populate_array can be nice.

In old API the transformations between json and row/record types is well
covered, but for array, only direction array->json is covered

I think so this can be +/- 40 lines of C code

> Let's hope it gets submitted 17-ish, anyway
>
> Erik
>
>
>
>
>
>

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Chapman Flack 2023-08-14 13:47:27 Re: proposal: jsonb_populate_array
Previous Message Erik Rijkers 2023-08-14 13:11:27 Re: proposal: jsonb_populate_array