From: Tom Lane on
Josh Berkus <josh(a)agliodbs.com> writes:
> Since former SQL Server / Sybase apps are the most likely to use named
> parameter notation in PostgreSQL, having a syntax which could be ported
> using only "sed" would be nice.

I fear you're vastly overestimating the ability of sed to distinguish
between = used in this way and = used in any other way. Still, putting
the parameter name on the left is clearly both more natural and more
like every other product.

regards, tom lane

--
Sent via pgsql-hackers mailing list (pgsql-hackers(a)postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

From: Tom Lane on
Andrew Dunstan <andrew(a)dunslane.net> writes:
> Yeah. Whether or not we ever implement it really doesn't matter, IMO. We
> should not be in the business of taking an SQL standard piece of syntax
> and using it for some other purpose.

Evidently the 201x SQL standard has blindsided us twice: first by
defining a syntax for named parameters that wasn't like ours, and second
by defining a syntax for something else that conflicted with ours.
I agree that the AS approach is pretty untenable given that double
whammy, and we'd better get rid of it. (Hopefully Peter will be able
to keep us better apprised of things in the future.)

It seems that we're agreed on trying to use := instead, and the only
debate is about whether to deprecate use of => as an operator. But
anything that we might do about the latter would reach no farther than
the documentation in 9.0 anyway.

regards, tom lane

--
Sent via pgsql-hackers mailing list (pgsql-hackers(a)postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

From: Robert Haas on
On Fri, May 28, 2010 at 10:08 AM, Pavel Stehule <pavel.stehule(a)gmail.com> wrote:
> 2010/5/28 Tom Lane <tgl(a)sss.pgh.pa.us>:
>> Heikki Linnakangas <heikki.linnakangas(a)enterprisedb.com> writes:
>>>> Peter Eisentraut<peter_e(a)gmx.net>  writes:
>>>>> How about
>>>>> select myfunc(a := 7, b := 6);
>>
>>> If we go with that, should we make some preparations to allow => in the
>>> future? Like provide an alternative operator name for hstore's =>, and
>>> add a note somewhere in the docs to discourage other modules from using =>.
>>
>> I'd vote no.  We're intentionally choosing to deviate from a very poor
>> choice of notation.  Maybe Peter can interest the committee in allowing
>> := as an alternate notation, instead.
>
> -1
>
> I prefer a standard. And again - it isn't poor syntax - ADA, Perl use
> it, It can be a funny if ANSI SQL committee change some design from
> Oracle's proposal to PostgreSQL's proposal.

I agree. It's good syntax. I think we should try hard to adopt it.

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise Postgres Company

--
Sent via pgsql-hackers mailing list (pgsql-hackers(a)postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

From: Dimitri Fontaine on
Heikki Linnakangas <heikki.linnakangas(a)enterprisedb.com> writes:
> On 28/05/10 19:19, Josh Berkus wrote:
>> EXEC dbo.GetItemPrice @ItemCode = 'GXKP', @PriceLevel = 5
>
> Once you solve the problem of finding the '='s in the source, replacing them
> is exactly the same effort regardless of what you replace them with.

I guess it would be a choice of target between
'GXKP' AS ItemCode, 5 AS PriceLevel
and
ItemCode := 'GXKP', PriceLevel := 5

By the way, as it seems we're voting, I much prefer := than either the
AS and => variant, and I'm not keen on seeing us deprecate the operator.

Further, as said Andrew, keeping AS conflicting with the standard with
no hysterical raisin to do so would be a bad move IMHO.

Regards,
--
dim

--
Sent via pgsql-hackers mailing list (pgsql-hackers(a)postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

From: Tom Lane on
So as far as I can tell, no one is opposed to replacing "expr AS name"
with "name := expr" in the named-parameter syntax. Obviously we had
better get this done before beta2. Is anyone actually working on the
code/docs changes? If not, I'll pick it up.

regards, tom lane

--
Sent via pgsql-hackers mailing list (pgsql-hackers(a)postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers