append jsonb array to another jsonb array

From: Joao Miguel Ferreira <joao(dot)miguel(dot)c(dot)ferreira(at)gmail(dot)com>
To: pgsql-general <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: append jsonb array to another jsonb array
Date: 2021-02-17 19:44:32
Message-ID: CALyyT7SdxPpF8PhvTpdNAjBvY2JdZLxA-zrGdm1D1VfPryvSPQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hello all,

I PL/pgSQL I have a few jsonb variables (instantiated each with an array of
objects) and I need to append them to produce the final result. All of them
are small in size (max 30 each). We are using Pg 11.

Example:
a = [ x, y ]
b = [ z , w ]
result would be [ x, y, z, w ]

What would you consider to be a suitable approach ?

thanks
João

Responses

Browse pgsql-general by date

  From Date Subject
Next Message David G. Johnston 2021-02-17 19:50:16 Re: append jsonb array to another jsonb array
Previous Message Paul van der Linden 2021-02-17 19:40:17 Re: Slow index creation