Re: multiple CREATE FUNCTION AS items for PLs - Mailing list pgsql-hackers

From Pavel Stehule
Subject Re: multiple CREATE FUNCTION AS items for PLs
Date
Msg-id CAFj8pRAV864t9_Rp6031caWBKvoBtysEtzXHSu7M-Sj5xc9=0A@mail.gmail.com
Whole thread Raw
In response to Re: multiple CREATE FUNCTION AS items for PLs  (Peter Eisentraut <peter_e@gmx.net>)
Responses Re: multiple CREATE FUNCTION AS items for PLs  (Hitoshi Harada <umi.tanuki@gmail.com>)
List pgsql-hackers
2012/12/28 Peter Eisentraut <peter_e@gmx.net>:
> On Mon, 2012-12-17 at 16:34 -0500, Peter Eisentraut wrote:
>> 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')
>
> An alternative that has some amount of precedent in the Python world
> would be to use comment pragmas, like this:
>
>         CREATE FUNCTION foo(a,b,c) AS $$
>         # plpython: module
>         import x
>          from __future__ import nex_cool_feature
>
>          def helper_function(x):
>             ...
>
>          def __pg_main__(a,b,c):
>              defined function body here
>
>         $$;
>
> The source code parser would look for this string on, say, the first two
> lines, and then decide which way to process the source text.
>
> This way we could get this done fairly easily without any new
> infrastructure outside the language handler.

this concept looks like more stronger and cleaner

+1

I thing so same idea is used in PL/v8

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 by date:

Previous
From: Peter Eisentraut
Date:
Subject: Re: multiple CREATE FUNCTION AS items for PLs
Next
From: Dimitri Fontaine
Date:
Subject: Re: Proposal: Store "timestamptz" of database creation on "pg_database"