Re: JSONB filed with default JSON from a file - Mailing list pgsql-general

From Tom Lane
Subject Re: JSONB filed with default JSON from a file
Date
Msg-id 23116.1534183874@sss.pgh.pa.us
Whole thread Raw
In response to Re: JSONB filed with default JSON from a file  (Merlin Moncure <mmoncure@gmail.com>)
Responses Re: JSONB filed with default JSON from a file
List pgsql-general
Merlin Moncure <mmoncure@gmail.com> writes:
> On Mon, Aug 13, 2018 at 12:56 PM mrcasa bengaluru <mrcasablr@gmail.com> wrote:
>> Thanks! However, this involves writing the entire JSON in the schema file looks inconvenient. I was hoping I would
beable to reference to an external JSON file which could be used for the default value. 

> [ put it in a table instead ]

Yeah.  If you really insist on having it in a file outside the database,
you can, but you'll need a superuser-privileged function to read it
from that file.  Aside from the security aspects, this sort of thing
is an antipattern because it opens you up to backup/restore problems
("oh, we needed that file too?"), replication problems, yadda yadda.
And what are you buying by doing it like that?  Better to keep it inside
the DB instead.

            regards, tom lane


pgsql-general by date:

Previous
From: Merlin Moncure
Date:
Subject: Re: JSONB filed with default JSON from a file
Next
From: Rob Sargent
Date:
Subject: Re: JSONB filed with default JSON from a file