Re: PL/pgSQL function to run DDL on a remote server/cluster? - Mailing list pgsql-admin

From Tom Lane
Subject Re: PL/pgSQL function to run DDL on a remote server/cluster?
Date
Msg-id 1951203.1679598919@sss.pgh.pa.us
Whole thread Raw
In response to Re: PL/pgSQL function to run DDL on a remote server/cluster?  (Laurenz Albe <laurenz.albe@cybertec.at>)
Responses Re: PL/pgSQL function to run DDL on a remote server/cluster?  (Laurenz Albe <laurenz.albe@cybertec.at>)
List pgsql-admin
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.

            regards, tom lane



pgsql-admin by date:

Previous
From: Laurenz Albe
Date:
Subject: Re: PL/pgSQL function to run DDL on a remote server/cluster?
Next
From: Laurenz Albe
Date:
Subject: Re: PL/pgSQL function to run DDL on a remote server/cluster?