Re: Anonymous code block with parameters - Mailing list pgsql-hackers

From Vik Fearing
Subject Re: Anonymous code block with parameters
Date
Msg-id 5419E9F9.90703@dalibo.com
Whole thread Raw
In response to Re: Anonymous code block with parameters  (Heikki Linnakangas <hlinnakangas@vmware.com>)
Responses Re: Anonymous code block with parameters  (Pavel Stehule <pavel.stehule@gmail.com>)
List pgsql-hackers
On 09/16/2014 10:09 AM, Heikki Linnakangas wrote:
> On 09/16/2014 10:57 AM, Craig Ringer wrote:
>> On 09/16/2014 03:15 PM, Pavel Stehule wrote:
>>
>>> Why we don't introduce a temporary functions instead?
>>
>> I think that'd be a lot cleaner and simpler. It's something I've
>> frequently wanted, and as Hekki points out it's already possible by
>> creating the function in pg_temp, there just isn't the syntax sugar for
>> "CREATE TEMPORARY FUNCTION".
>>
>> So why not just add "CREATE TEMPORARY FUNCTION"?
> 
> Sure, why not.

Because you still have to do
   SELECT pg_temp.my_temp_function(blah);

to execute it.

>> It means two steps:
>>
>> CREATE TEMPORARY FUNCTION ... $$ $$;
>>
>> SELECT my_temp_function(blah);

That won't work; see above.
-- 
Vik



pgsql-hackers by date:

Previous
From: Pavel Stehule
Date:
Subject: Re: proposal: plpgsql - Assert statement
Next
From: Pavel Stehule
Date:
Subject: Re: Anonymous code block with parameters