In need of some JSONB examples ? - Mailing list pgsql-general

From Tim Smith
Subject In need of some JSONB examples ?
Date
Msg-id CA+HuS5GTgr-OKJTZj+=rvJ=y5T7yEyGJoR+NrFpy5iCnXN8Z_w@mail.gmail.com
Whole thread Raw
Responses Re: In need of some JSONB examples ?  (Merlin Moncure <mmoncure@gmail.com>)
List pgsql-general
Hi,

I've tried RTFMing on the wonderful new 9.4 jsonb features, but
there's a little bit of a lack of examples as to how to do stuff.

I've got a document loaded in to a jsonb column that looks something like :

[{"ID":"1","location_name":"Test"},{"ID":"2","location_name":"Examples"}]

Anyway, there are a few thousands elements in that JSON array and I've
tried all sorts of combinations, but I simply can't manage to figure
out how to :

(a) Search by ID
(b) Do the equivalent of select * to list all IDs and Locations (one
of my end goals being the ability to do a "select into" from the JSON
into a standard database table)

On a completely unrelated note, I don't suppose Postgresql has any
built-in functionality to convert the output from an SQL query into
JSON ?

Tim


pgsql-general by date:

Previous
From: Alban Hertroys
Date:
Subject: Re: How to create a specific table
Next
From: Petr Novak
Date:
Subject: CLOG read problem after pg_basebackup