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