Re: functional call named notation clashes with SQL feature - Mailing list pgsql-hackers

From Andrew Dunstan
Subject Re: functional call named notation clashes with SQL feature
Date
Msg-id 4C0AB471.2020209@dunslane.net
Whole thread Raw
In response to Re: functional call named notation clashes with SQL feature  ("David E. Wheeler" <david@kineticode.com>)
List pgsql-hackers

David E. Wheeler wrote:
> On Jun 5, 2010, at 7:02 AM, Tom Lane wrote:
>
>   
>> From a usability point of view, if we adopt the spec's syntax we have to
>> stop allowing => for any other purpose.  Period.
>>     
>
> What if we added a new "dual" type and limited the => operator only to that type, being, essentially, a constructor.
Thenhstore and function call param processing could be rewritten to transform those types into key/value pairs.
 
>
> So you'd call functions with:
>
>  foo( bar => 1, baz => 'this');
>
> Actually, now that I think about it, the hstore => basically does this: it constructs an hstore from its two values.
Sowhy not basically move hstore into core and just use it for function arguments?
 
>
> Crazy idea, I know, but thought I'd just throw it out there.
>   

I'm fairly strongly inclined to go with Tom's original dictum above. 
Even if it's not strictly true, doing anything else is likely to be 
rather fragile, ISTM.

cheers

andrew


pgsql-hackers by date:

Previous
From: "David E. Wheeler"
Date:
Subject: Re: functional call named notation clashes with SQL feature
Next
From: Dean Rasheed
Date:
Subject: Out of date docs: DISABLE/ENABLE TRIGGER