Re: functional call named notation clashes with SQL feature

From: Jan Wieck <JanWieck(at)Yahoo(dot)com>
To: Andrew Dunstan <andrew(at)dunslane(dot)net>
Cc: Bruce Momjian <bruce(at)momjian(dot)us>, Peter Eisentraut <peter_e(at)gmx(dot)net>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: functional call named notation clashes with SQL feature
Date: 2010-06-04 02:47:06
Message-ID: 4C08692A.9060003@Yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 5/27/2010 11:52 PM, Andrew Dunstan wrote:
>
> Bruce Momjian wrote:
>> Peter Eisentraut wrote:
>>
>>> On tor, 2010-05-27 at 12:59 -0400, Tom Lane wrote:
>>>
>>>>> I think we should fix it now. Quick thought: maybe we could use
>>>>>
>>>> FOR
>>>>
>>>>> instead of AS: select myfunc(7 for a, 6 for b);
>>>>>
>>>> I'm afraid FOR doesn't work either; it'll create a conflict with the
>>>> spec-defined SUBSTRING(x FOR y) syntax.
>>>>
>>> How about
>>>
>>> select myfunc(a := 7, b := 6);
>>>
>>
>> One concern I have is that in PL/pgSQL, := and = behave the same, while
>> in SQL, they would not. That might cause confusion.
>>
>>
>
> That is a sad wart that we should never have done, IMNSHO (it was before
> my time or I would have objected ;-) ). But beyond that, = is an
> operator in SQL and := is never an operator, IIRC.

As far as I can tell, this was already in the code when Bruce moved it
into core as -r1.1 on my behalf (before I had commit privileges). I do
not recall if the = as alternative to := was my idea or not. But I'm
willing to take the blame for it because it dates back to a time where
convenience seemed important.

Jan

--
Anyone who trades liberty for security deserves neither
liberty nor security. -- Benjamin Franklin

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2010-06-04 02:55:40 Re: [pgsql-hackers] Daily digest v1.10705 (13 messages)
Previous Message Bruce Momjian 2010-06-04 02:19:10 Re: 9.0 release notes