Re: JSONB filed with default JSON from a file

2018-08-13 Thread Rob Sargent
On 08/13/2018 12:11 PM, Tom Lane wrote: Merlin Moncure writes: On Mon, Aug 13, 2018 at 12:56 PM mrcasa bengaluru wrote: Thanks! However, this involves writing the entire JSON in the schema file looks inconvenient. I was hoping I would be able to reference to an external JSON file which c

Re: JSONB filed with default JSON from a file

2018-08-13 Thread Tom Lane
Merlin Moncure writes: > On Mon, Aug 13, 2018 at 12:56 PM mrcasa bengaluru wrote: >> Thanks! However, this involves writing the entire JSON in the schema file >> looks inconvenient. I was hoping I would be able to reference to an external >> JSON file which could be used for the default value.

Re: JSONB filed with default JSON from a file

2018-08-13 Thread Merlin Moncure
On Mon, Aug 13, 2018 at 12:56 PM mrcasa bengaluru wrote: >> >> I assume that you could declare the column as >> >> address jsonb not null default 'your json here'::jsonb; > > > Thanks! However, this involves writing the entire JSON in the schema file > looks inconvenient. I was hoping I would be

Re: JSONB filed with default JSON from a file

2018-08-13 Thread mrcasa bengaluru
> > I assume that you could declare the column as > > address jsonb not null default 'your json here'::jsonb; > Thanks! However, this involves writing the entire JSON in the schema file looks inconvenient. I was hoping I would be able to reference to an external JSON file which could be used for t

Re: JSONB filed with default JSON from a file

2018-08-13 Thread Charles Clavadetscher
Hi --- Charles Clavadetscher Neugasse 84 CH - 8005 Zürich Tel: +41-79-345 18 88 - > On 13.08.2018, at 19:40, mrcasa bengaluru wrote: > > All, > > I'm new to JSONB datatype. We would like to store a nested JSON file in this >

JSONB filed with default JSON from a file

2018-08-13 Thread mrcasa bengaluru
All, I'm new to JSONB datatype. We would like to store a nested JSON file in this field. Since the JSON is nested, we wanted to create JSON with default value from an external JSON file. My address table looks like, CREATE TABLE address ( id CHAR(36) UNIQUE NOT NULL, address JSONB NOT NULL ); F