Re: CREATE ROUTINE MAPPING

Поиск
Список
Период
Сортировка
От Ashutosh Bapat
Тема Re: CREATE ROUTINE MAPPING
Дата
Msg-id CAFjFpReOy2SCU=HRFs9GafP9QgMp0L=kqtYzfMwvAmCh_vJo6Q@mail.gmail.com
обсуждение исходный текст
Ответ на CREATE ROUTINE MAPPING  (Corey Huinker <corey.huinker@gmail.com>)
Ответы Re: CREATE ROUTINE MAPPING
Re: CREATE ROUTINE MAPPING
Список pgsql-hackers
On Fri, Jan 12, 2018 at 8:07 AM, Corey Huinker <corey.huinker@gmail.com> wrote:
> A few months ago, I was researching ways for formalizing calling functions
> on one postgres instance from another. RPC, basically. In doing so, I
> stumbled across an obscure part of the the SQL Standard called ROUTINE
> MAPPING, which is exactly what I'm looking for.
>
> The syntax specified is, roughly:
>
> CREATE ROUTINE MAPPING local_routine_name FOR remote_routine_spec
> SERVER my_server [ OPTIONS( ... ) ]
>
>
> Which isn't too different from CREATE USER MAPPING.
>
> The idea here is that if I had a local query:
>
> SELECT t.x, remote_func1(),  remote_func2(t.y)
>
> FROM remote_table t
>
> WHERE t.active = true;
>
>
> that would become this query on the remote side:
>
> SELECT t.x, local_func1(), local_func2(t.y)
>
> FROM local_table t
>
> WHERE t.active = true;
>

I think this is a desired feature. Being able to call a function on
remote server through local server is often useful.

PostgreSQL allows function overloading, which means that there can be
multiple functions with same name differing in argument types. So, the
syntax has to include the input parameters or their types at least.

-- 
Best Wishes,
Ashutosh Bapat
EnterpriseDB Corporation
The Postgres Database Company


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Anthony Bykov
Дата:
Сообщение: Re: Transform for pl/perl
Следующее
От: David Rowley
Дата:
Сообщение: Re: [HACKERS] path toward faster partition pruning