Re: multiple CREATE FUNCTION AS items for PLs

Поиск
Список
Период
Сортировка
От Pavel Stehule
Тема Re: multiple CREATE FUNCTION AS items for PLs
Дата
Msg-id CAFj8pRA1vfB7Vk9jjRS+tUOnXLUn0E8-n=HzHpmk43hV+kxpJQ@mail.gmail.com
обсуждение исходный текст
Ответ на Re: multiple CREATE FUNCTION AS items for PLs  (Peter Eisentraut <peter_e@gmx.net>)
Список pgsql-hackers
2012/12/17 Peter Eisentraut <peter_e@gmx.net>:
> On 12/16/12 1:20 PM, Hannu Krosing wrote:
>> I was going to suggest some special function name to be pulled out of code
>> passed to CREATE FUNCTION in line with
>>
>>     CREATE FUNCTION foo(a,b,c) AS $$
>>     import x
>>         from __future__ import nex_cool_feature
>>
>>         def helper_function(x):
>>            ...
>>
>>         def __pg_main__(a,b,c):
>>             defined function body here
>>
>>     $$;
>>
>> so that the whole text gets compiled into module at first call and the
>> __pg_main__ will
>> be the function that gets called as foo(a,b,c) from postgresql
>>
>> but this would not be backwards compatible, at least not in any obvious way.
>
> Yes, this would be a good solution for some applications, but the only
> way I can think of to manage the compatibility issue is to invent some
> function attribute system like
>
> CREATE FUNCTION ... OPTIONS (call_convention 'xyz')
>
> But this is also a lot more typing, so the two-part AS solution still
> has some appeal if you just want an import.
>

two-part AS is not intuitive and it is looking really obscure

Regards

Pavel

>
> --
> Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-hackers



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

Предыдущее
От: Simon Riggs
Дата:
Сообщение: Re: Enabling Checksums
Следующее
От: Simon Riggs
Дата:
Сообщение: Re: Error restoring from a base backup taken from standby