Re: proposal sql: labeled function params

From: "Pavel Stehule" <pavel(dot)stehule(at)gmail(dot)com>
To: "Asko Oja" <ascoja(at)gmail(dot)com>
Cc: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>, "Robert Haas" <robertmhaas(at)gmail(dot)com>, "Bruce Momjian" <bruce(at)momjian(dot)us>, "Hannu Krosing" <hannu(at)2ndquadrant(dot)com>, Decibel! <decibel(at)decibel(dot)org>, "Peter Eisentraut" <peter_e(at)gmx(dot)net>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: proposal sql: labeled function params
Date: 2008-08-22 05:22:44
Message-ID: 162867790808212222ub5324eeq7562339cbc0233df@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

2008/8/21 Asko Oja <ascoja(at)gmail(dot)com>:
> Would AS be harder to implement?
>
> select foo(10 AS a, 20 AS b);
> select foo(20 AS b, 20 AS a);
> select x(0 >= 1 AS a);
>
> other fantasies
> select foo(10 a, 20 b);
> select foo("a" 10, "b" 20);

no, I have it. Problem is in semantic. There are two features, that
fight about this keyword - named params and labeled params. I don't
thing so using AS for named params is good idea - mainly it's out of
standard (if I should count with SQL/XML) and out of tradition.

regards
Pavel

p.s. => is clean and readable, I thing it's better than space syntax
:)

>
> regards,
> Asko
>
> On Wed, Aug 20, 2008 at 4:26 PM, Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
> wrote:
>>
>> 2008/8/20 Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>:
>> > "Pavel Stehule" <pavel(dot)stehule(at)gmail(dot)com> writes:
>> >> I understand now why Oracle use => symbol for named params. This isn't
>> >> used so operator - so implementation is trivial.
>> >
>> > You really didn't understand the objection at all, did you?
>> >
>> > The point is not about whether there is any built-in operator named =>.
>> > The point is that people might have created user-defined operators named
>> > that.
>>
>> I understand well, so only I don't see better solution. Yes, everyone
>> who used => should have problems, but it is similar with .. new
>> keywords, etc. Probably easy best syntax doesn't exist :(. I haven't
>> idea who use => now and how often, and if this feature is possible in
>> pg, but there are not technical barriers.
>>
>> regards
>> Pavel Stehule
>>
>>
>> >
>> > regards, tom lane
>> >
>>
>> --
>> Sent via pgsql-hackers mailing list (pgsql-hackers(at)postgresql(dot)org)
>> To make changes to your subscription:
>> http://www.postgresql.org/mailpref/pgsql-hackers
>
>

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tatsuhito Kasahara 2008-08-22 05:27:35 Re: About a message when "pg_ctl -w start" failed
Previous Message Decibel! 2008-08-22 04:47:00 Re: [GENERAL] Surprising syntax error