Re: SQL equivalint of #incude directive ? - Mailing list pgsql-general

From Thomas Kellerer
Subject Re: SQL equivalint of #incude directive ?
Date
Msg-id 963ecca0-9449-e5e4-c3db-12d933a553ec@gmx.net
Whole thread Raw
In response to SQL equivalint of #incude directive ?  (stan <stanb@panix.com>)
List pgsql-general
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.






pgsql-general by date:

Previous
From: Justin Pryzby
Date:
Subject: Re: postgres=# VACUUM FULL pg_statistic => ERROR: missing chunknumber 0 for toast value .. in pg_toast_2619
Next
From: Rich Shepard
Date:
Subject: Escape parentheses in aggregate function