proposal: jsonb_populate_array

From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: proposal: jsonb_populate_array
Date: 2023-08-14 03:51:57
Message-ID: CAFj8pRAPGu_ka4S-pxKKOJCta29KAaBMxGNGJkmiD5T=s+EBgA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi

Now, there is no native functionality for conversion from json(b) value to
some array.

https://stackoverflow.com/questions/76894960/unable-to-assign-text-value-to-variable-in-pgsql/76896112#76896112

It should not be too hard to implement native function jsonb_populate_array

jsonb_populate_array(anyarray, jsonb) returns anyarray

Usage:

select jsonb_populate_array(null::text[], '["cust_full_name","cust_email"]')

Comments, notes?

Regards

Pavel

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Geoghegan 2023-08-14 04:33:30 Re: Naive handling of inequalities by nbtree initial positioning code
Previous Message Masahiro Ikeda 2023-08-14 03:31:05 Re: Support to define custom wait events for extensions