From: Thomas Kellerer <spam_eater@gmx.net>
To: pgsql-general@lists.postgresql.org
Subject: Re: SQL equivalint of #incude directive ?
Date: Fri, 30 Aug 2019 16:52:04 +0200
Message-ID: <963ecca0-9449-e5e4-c3db-12d933a553ec@gmx.net> (raw)
In-Reply-To: <20190830134859.GA24151@panix.com>
References: <20190830134859.GA24151@panix.com>
stan schrieb am 30.08.2019 um 15:48:
> I thought this would be common. But a quick Google only revealed what look to be
> workarounds.
>
> I am defining a bunch of functions, and I would prefer to store them in a
> separate file, which then gets "source" by the main DB init file.
>
> Is there a standard way to do this?
Define "standard".
With psql you can use the \i directive from within a SQL script.
But that does not work with other SQL clients.
It all depends on the SQL client you use to run those scripts.
I use Liquibase to manage schema setup and migration - that has a totally different "include" directive then psql.
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-general@postgresql.org
Cc: spam_eater@gmx.net
Subject: Re: SQL equivalint of #incude directive ?
In-Reply-To: <963ecca0-9449-e5e4-c3db-12d933a553ec@gmx.net>
References: <20190830134859.GA24151@panix.com> <963ecca0-9449-e5e4-c3db-12d933a553ec@gmx.net>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox