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

From Joseph Adams
Subject Re: functional call named notation clashes with SQL feature
Date
Msg-id AANLkTimn00fdGTNfu7udvXDAy0gKu4gbZ030_68Wzgtb@mail.gmail.com
Whole thread Raw
In response to Re: functional call named notation clashes with SQL feature  (Joseph Adams <joeyadams3.14159@gmail.com>)
List pgsql-hackers
On Fri, Jun 4, 2010 at 9:55 PM, Joseph Adams <joeyadams3.14159@gmail.com> wrote:
> If I had to choose between => and := for parameter naming, I'd go with
> := because it seems more SQLish to me.

On second thought, => might actually be a very intuitive syntax for
defining dictionary types like hstore and json, since it matches PHP's
associative array syntax, as in:

hstore('key1' => 'value1', 'key2' => 'value2') -- hypothetical SQL
array('key1' => 'value1', 'key2' => 'value2') // PHP

That way, when people see =>, they can think "dictionary" whether
they're in PHP or SQL.

Note that this is a bit different than what I suggested earlier:

hstore(key1 => 'value1', key2 => 'value2')

Identifier names were used instead of literal names, which conflicts
with the other approach.  Also, the other approach is more flexible,
as the user can generate names with expressions at runtime.


pgsql-hackers by date:

Previous
From: Greg Stark
Date:
Subject: Re: recovery getting interrupted is not so unusual as it used to be
Next
From: Tom Lane
Date:
Subject: Re: functional call named notation clashes with SQL feature