Re: multiple CREATE FUNCTION AS items for PLs

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Hannu Krosing <hannu(at)krosing(dot)net>
Cc: Peter Eisentraut <peter_e(at)gmx(dot)net>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: multiple CREATE FUNCTION AS items for PLs
Date: 2012-12-18 00:47:37
Message-ID: 13379.1355791657@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hannu Krosing <hannu(at)krosing(dot)net> writes:
> On 12/17/2012 10:34 PM, 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')

> How about using a GUC for setting calling convention?

GUCs are a truly bad fit for properties that need to be function-local.

> This SET can be even done as part of CREATE FUNCTION .
> CREATE FUNCTION $$ ... $$ ... SET plpython.cc=9.2;

That doesn't fix the problem, because a setting made that way will
affect called functions too. The only way you could use it safely
would be to add such a SET clause to every single plpython function
in the database. At that point an OPTIONS clause (which can have a
backwards-compatible default behavior) looks a lot more attractive.

I still think that embedding some type of extension syntax in the
function body is the best solution. But if that's too ugly, let's
invent something like Peter's OPTIONS syntax above, with the
understanding that it affects only the function it's applied to
(unlike SET), and contains PL-specific options.

regards, tom lane

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2012-12-18 00:53:31 Re: pg_basebackup from cascading standby after timeline switch
Previous Message Bruce Momjian 2012-12-18 00:30:08 Re: small pg_basebackup display bug