Re: Execute a function through fdw

From: Jeff Janes <jeff(dot)janes(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Guillaume Lelarge <guillaume(at)lelarge(dot)info>, Patrick FICHE <Patrick(dot)Fiche(at)aqsacom(dot)com>, "pgsql-generallists(dot)postgresql(dot)org" <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: Re: Execute a function through fdw
Date: 2019-10-19 19:55:59
Message-ID: CAMkU=1yHQvyPO0q9UugxBzWJR0ZppbVQ_jn8fM9N1ZYpBHkpFg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Fri, Oct 18, 2019 at 7:55 AM Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:

> Guillaume Lelarge <guillaume(at)lelarge(dot)info> writes:
> > Le ven. 18 oct. 2019 à 11:51, Patrick FICHE <Patrick(dot)Fiche(at)aqsacom(dot)com>
> a
> > écrit :
> >> Is it possible to execute a function located on a server accessed
> through
> >> Postgres fdw.
>
> > It's probably easier to create a view on the remote server, and access it
> > as a foreign table on the local server.
>

Yes, that would probably work here, but if the function takes user-supplied
arguments, that won't work.

>
> Yeah. Or if you really want to call a remote function by name, see
> dblink. postgres_fdw actively avoids doing that sort of thing.
>

And importantly, you can specify the name of the existing postgres_fdw
server to the dblink functions in place of the connection string. This
removes quite a bit of the drudgery of using dblink, if you are already
using postgres_fdw.

Cheers,

Jeff

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Julie Nishimura 2019-10-19 23:17:57 Re: releasing space
Previous Message Ariadne Conill 2019-10-19 19:49:29 Re: jsonb_set() strictness considered harmful to data