Re: PL/pgSQL function to run DDL on a remote server/cluster?

From: Sbob <sbob(at)quadratum-braccas(dot)com>
To: Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Pgsql-admin <pgsql-admin(at)lists(dot)postgresql(dot)org>
Subject: Re: PL/pgSQL function to run DDL on a remote server/cluster?
Date: 2023-03-23 20:27:06
Message-ID: f06c6ea6-883a-966e-0ba3-ba4026f3a7ac@quadratum-braccas.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin


On 3/23/23 14:16, Laurenz Albe wrote:
> On Thu, 2023-03-23 at 15:15 -0400, Tom Lane wrote:
>> Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)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

Thanks Tom!

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Matt Gibbins 2023-03-25 00:55:35 Debian PostgreSQL 15 pg_createcluster - could not open collator for locale
Previous Message Laurenz Albe 2023-03-23 20:16:36 Re: PL/pgSQL function to run DDL on a remote server/cluster?