Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1i3iG8-0002id-C4 for pgsql-general@arkaria.postgresql.org; Fri, 30 Aug 2019 14:52:16 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1i3iG6-0003Vj-VS for pgsql-general@arkaria.postgresql.org; Fri, 30 Aug 2019 14:52:14 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1i3iG6-0003Th-IK for pgsql-general@lists.postgresql.org; Fri, 30 Aug 2019 14:52:14 +0000 Received: from mout.gmx.net ([212.227.15.18]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1i3iG4-0000kF-2D for pgsql-general@lists.postgresql.org; Fri, 30 Aug 2019 14:52:14 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1567176726; bh=A1W8dUNIRYgDk2HMprv7Ktvr3B3EUUkSP+b6mO43LfQ=; h=X-UI-Sender-Class:Subject:To:References:From:Date:In-Reply-To; b=jTwKo9JVbMlF6dAB3yn2rzdPMRO6NowRafRb275RrSjYZg/XR8cZMdWnDuaeMXHaO 1XCKgmVl8kyE+70IC5hdfkMA2OScILyI9Q2wn0u5ho/IAjmU8bxLWN7ApW+i/v+mf0 GlVP7GGcxWq8O6WOzz+z1Ll44CcOLryn9FDxOuzc= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from [192.168.178.37] ([188.174.168.148]) by mail.gmx.com (mrgmx001 [212.227.17.190]) with ESMTPSA (Nemesis) id 0LfkUs-1iWwPM25mM-00pMTx for ; Fri, 30 Aug 2019 16:52:06 +0200 Subject: Re: SQL equivalint of #incude directive ? To: pgsql-general@lists.postgresql.org References: <20190830134859.GA24151@panix.com> From: Thomas Kellerer Message-ID: <963ecca0-9449-e5e4-c3db-12d933a553ec@gmx.net> Date: Fri, 30 Aug 2019 16:52:04 +0200 User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; de; rv:1.8.1.21) Gecko/20090302 Thunderbird/2.0.0.21 Mnenhy/0.7.5.666 MIME-Version: 1.0 In-Reply-To: <20190830134859.GA24151@panix.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: de-DE Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:t4Mf+o6+A2WTt6qs0rJoas7xL026jShAP+JZC9HuDNe61uYOCCV GokLDmW1GGm9SI8oGfUopM3FwNrXFMokLiK87G58FKTcGlttfYtdrMgAE4bhSnQof8EQfWT Fmj3i8Vuwtdovax7mSmh5KqT4cvODWzG7KRL475G1YZAAII4reoW5BUZZn9D7GBhSdQ21BD /cpASZKAQZYhkmJXNg5ZQ== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:6QEJ9zxE9Ng=:czSyVKbgkzz1pmtie5TgYz eLS9oiG78wY2+w/bPexwk+1n1+vEsUJfeWkHXi1ACBeHBOLFLUpD7SnVJedKhN2r84CpfbiPh kqD6ocE63oC6E+BWKJBmQziCs/RjVqN95KfIFeLmN9LWskSnHmy41ZW6kVdgR0mRW4ELaEfhb yKmPdHVzPG087zenSql83BYc8eSplSHc1Y0n/1kQkBbw+yq+EZeB8Gm/rPHQAQ1LpkmjXRx3K 1YwGuNd2qKw2qi/mm9QZdM/KUjS19suuSY2H5YE5Ln1Kt+37RXwgUlAawpVoH61Sh99Hi8Xgm LMXNxSa8SJ1G8xDJXB7ZwGLaPkIIPzFK+erLH6BOcG5cCZfDrQo7dcmY4jWrWy4UzDlhanBkW nATsoMUnKC3G9zA9ed2OcZK37mHHuBPcgYTLKFAB7hEoWZaA1NO4p0d43M+eOKFiOhtOkbWzS sN6ulDq8JxohRmZdjWDW4sh/xR44NQCeJNqGBcdv73nMG+fOILk7qU2S6ocWtPaZzpaI77Ifn G0B0N5tQSw0VHALmkOD03TT0aTIwF1/7BYn6MYjPKjf/2RbXEtWr3Ty0u+x+L2EQNWIGzk11h Izcdfb1QFxygp7PEoctsLBz5Ti1DOGrvHWxK1fSvXq6kBsarjR1U0c6hLG5rbhJM7I8/ha5U5 +Ne5ZtukwwyMkYoDFxxGO2FiL0TAcPnNB395/hqNsXa3pao9QqNPWI63y6Alaltugz9fEL8zs 5wjchnZTyMSaw6D6c4F3awtBCNAEag2xb3oHl8dK0mSLS1KN/zC286yXpE9prXLjRDcWfN5aU UHwEBPRmO9fDHq3kM+EZqcrWnTL+x9XN5h1MLF9tuBQXtLYHpgCN0VYVxnH/zEmbi2+DZWryl pKTpsB22svO2YkxAp5p3WGsQpWqZIaO5s4dghm3LQX98aZ6jM2hjxETA8VX1eHkHT7lNSZVuW 8p1rrVKR71OykaDYx63esr3dIXH8+XaiLdqlbj0O1AYEiC2N9FYq/QVtHcjZQApVrt/tFVrkS Y9SdndifVvwz5FGgVGAHjG4We34R5Wceq1byraj4Yy/iIcRh/U6rSClF1078H3fLVt8uNq2rd KRmj6ZWaT93nA3dLLkiajgAlU6gaRE1aGbZIGk7stLPZWj7LG52Rwwh4xxjB0/4DVNOauotDP wB0yR3gIDsPkJlTHQfJqHNDHmHvjabAK/3YRAfdiPJ2b2KYg== List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk stan schrieb am 30.08.2019 um 15:48: > I thought this would be common. But a quick Google only revealed what lo= ok to be > workarounds. > > I am defining a bunch =7Fof 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.