Re: proposal: jsonb_populate_array - Mailing list pgsql-hackers

From Pavel Stehule
Subject Re: proposal: jsonb_populate_array
Date
Msg-id CAFj8pRCMm6LM7=ej=e7SBzzs7eGxV8TbvurPgwmDxX1mC844uQ@mail.gmail.com
Whole thread Raw
In response to Re: proposal: jsonb_populate_array  (Erik Rijkers <er@xs4all.nl>)
Responses Re: proposal: jsonb_populate_array
List pgsql-hackers


po 14. 8. 2023 v 15:09 odesílatel Erik Rijkers <er@xs4all.nl> napsal:
Op 8/14/23 om 14:51 schreef Pavel Stehule:> po 14. 8. 2023 v 11:32
odesílatel Alvaro Herrera <alvherre@alvh.no-ip.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.







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

Erik





pgsql-hackers by date:

Previous
From: Erik Rijkers
Date:
Subject: Re: proposal: jsonb_populate_array
Next
From: Chapman Flack
Date:
Subject: Re: proposal: jsonb_populate_array