Re: Should I use JSON?

From: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
To: stan <stanb(at)panix(dot)com>
Cc: pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: Re: Should I use JSON?
Date: 2020-05-21 15:55:23
Message-ID: CAKFQuwbWTQL-tycmzH-0=9iC1oTyuMu0gZPO=xw=ciA=7fNapQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Thu, May 21, 2020 at 8:37 AM stan <stanb(at)panix(dot)com> wrote:

> So here is the question, should I just manually parse this data, as I have
> been doing to insert into appropriate entities into the database? Or
> should I
> insert the JSON data, and use some queries in the database to populate my
> tables from the JSON tables?
>

The simplest thing that works is usually a good starting point.

I consider it a requirement that I can get to the original data as supplied
by the vendor. So, if you are capturing that elsewhere, going directly to
structured tables is sufficient. If you don't have any other place where
that gets saved I would save it to a table first then convert it to the
final structured tables.

My current setup is using "jq" to perform an intermediate transform of the
source json to table-specific files and then using psql and jsonb_to_record
insert the json data into the tables.

David J.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Adrian Klaver 2020-05-21 15:57:50 Re: Table partitioning for cloud service?
Previous Message Israel Brewster 2020-05-21 15:53:11 Re: Table partitioning for cloud service?