Re: json select question

From: "FarjadFarid\(ChkNet\)" <farjad(dot)farid(at)checknetworks(dot)com>
To: "'CS DBA'" <cs_dba(at)consistentstate(dot)com>, "'pgsql-general'" <pgsql-general(at)postgresql(dot)org>
Subject: Re: json select question
Date: 2016-09-22 10:18:56
Message-ID: 005201d214ba$ba320ac0$2e962040$@checknetworks.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

This is probably the start of your quest into this project. No doubt you’ll need to handle other queries.

So my suggestion is first to rationalise the data storage before digging any deeper.

From: pgsql-general-owner(at)postgresql(dot)org [mailto:pgsql-general-owner(at)postgresql(dot)org] On Behalf Of CS DBA
Sent: 22 September 2016 00:54
To: pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: [GENERAL] json select question

All;

I'm working with a client running postgres 9.2, they have a table with a "json_data_string" column of type json

the data looks something like this with lots of rows for each (i.e. lots of json_data_string->book_name rows, lots of json_data_string->catalog_name rows, etc:

'{ "book_name": "Book the Fourth", "author": { "first_name": "Charles", "last_name": "Davis" } }'
'{ "catalog_name": "Catalog the Fourth", "author": { "first_name": "Charles", "last_name": "Davis" } }'
'{ "magazine_name": "mag4", "author": { "first_name": "Charles", "last_name": "Davis" } }'
'{ "category_name": "region", "author": { "first_name": "Charles", "last_name": "Davis" } }'


How can i pull a unique list of all json column names? such as book_name, catalog_name, etc

Thanks in advance

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2016-09-22 11:25:53 Re: Unstable C Function
Previous Message Ian Campbell 2016-09-22 05:59:12 Re: Unstable C Function