Re: WIP: default values for function parameters - Mailing list pgsql-hackers

From David E. Wheeler
Subject Re: WIP: default values for function parameters
Date
Msg-id A4D41CCA-5FCD-4597-BB5C-F5323F5D4400@kineticode.com
Whole thread Raw
In response to Re: WIP: default values for function parameters  (Bruce Momjian <bruce@momjian.us>)
Responses Re: WIP: default values for function parameters  ("Ian Caulfield" <ian.caulfield@gmail.com>)
Re: WIP: default values for function parameters  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: WIP: default values for function parameters  (Heikki Linnakangas <heikki.linnakangas@enterprisedb.com>)
List pgsql-hackers
On Dec 11, 2008, at 3:42 PM, Bruce Momjian wrote:

>> what do you thing about?
>>
>> select fce(p1,p2,p3, SET paramname1 = val, paramname2 = val)
>>
>> example
>> select dosome(10,20,30, SET flaga = true, flagb = false)
>
> I think AS read more naturally because you expect the parameter to  
> come
> first, not the SET keyword.

Coming to this a bit late, but it seems to me that, while it makes  
sense to assign a label to a value using "AS", it's kind of weird to  
use it to assign a value to a label.

SELECT foo( bar => 'ick', baz => 'ack' );
SELECT foo( bar AS 'ick', baz AS 'ack' );

As a Perl hacker, I'm strongly biased toward =>, but I guess AS isn't  
*too* bad. At least it's the same number of characters. Is -> right out?

Best,

David




pgsql-hackers by date:

Previous
From: Heikki Linnakangas
Date:
Subject: Re: [Patch] Space reservation (pgupgrade)
Next
From: Peter Eisentraut
Date:
Subject: Re: SQL/MED compatible connection manager