Re: Turn a json column into a table

From: Ion Alberdi <ion(dot)alberdi(at)pricemoov(dot)com>
To: Shaozhong SHI <shishaozhong(at)gmail(dot)com>
Cc: pgsql-sql <pgsql-sql(at)lists(dot)postgresql(dot)org>
Subject: Re: Turn a json column into a table
Date: 2022-02-15 07:52:18
Message-ID: CANbgw4DwDkSxZ1rn10rdHS51fy3vGQqN73sEDvg9GRH3WPE=aw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Hi David,
it seems (json_to_record, jsonb_to_record) may help in this use case.
https://www.postgresql.org/docs/9.4/functions-json.html

Regards

Le mar. 15 févr. 2022 à 08:21, Shaozhong SHI <shishaozhong(at)gmail(dot)com> a
écrit :

> There is a JSON column in a table. It contains key value pairs, just like
> a dictionary.
>
> Keys are column names. Values are values contained in a row.
>
> It looks like that each JSON object needs to be expanded into row values
> in different columns.
>
> What is the best way to turn this JSON column into a data table?
>
> Regards,
>
> David
>

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Karsten Hilbert 2022-02-15 08:09:32 Aw: Re: Turn a json column into a table
Previous Message Shaozhong SHI 2022-02-15 07:21:08 Turn a json column into a table