From: Laurenz Albe <laurenz.albe@cybertec.at>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Sbob <sbob@quadratum-braccas.com>
Cc: Pgsql-admin <pgsql-admin@lists.postgresql.org>
Subject: Re: PL/pgSQL function to run DDL on a remote server/cluster?
Date: Thu, 23 Mar 2023 21:16:36 +0100
Message-ID: <64362c8d5a5326d9911b9826dbc272dde8079b86.camel@cybertec.at> (raw)
In-Reply-To: <1951203.1679598919@sss.pgh.pa.us>
References: <f793707b-78a6-8c8a-367a-09a4a2a787b6@quadratum-braccas.com>
<ad07bcffd3ab3adc3a98dffa068e0e213d87e006.camel@cybertec.at>
<1951203.1679598919@sss.pgh.pa.us>
On Thu, 2023-03-23 at 15:15 -0400, Tom Lane wrote:
> Laurenz Albe <laurenz.albe@cybertec.at> writes:
> > On Thu, 2023-03-23 at 12:03 -0600, Sbob wrote:
> > > Is it possible to execute DDL on a remote server/cluster from a PL/pgSQL
> > > function?
> > > If so can someone point me to docs or an example?
>
> > You cannot do that with the built-in tools.
> > You'd have to write an extension that can do that.
>
> You do need an extension, but contrib/dblink should do fine.
Ah, of course. Silly of me.
Yours,
Laurenz Albe
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 using the --to and --cc options:
reply via email
To: pgsql-admin@postgresql.org
Cc: laurenz.albe@cybertec.at, tgl@sss.pgh.pa.us, sbob@quadratum-braccas.com, pgsql-admin@lists.postgresql.org
Subject: Re: PL/pgSQL function to run DDL on a remote server/cluster?
In-Reply-To: <64362c8d5a5326d9911b9826dbc272dde8079b86.camel@cybertec.at>
* 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