Re: functional call named notation clashes with SQL feature

From: Joseph Adams <joeyadams3(dot)14159(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Robert Haas <robertmhaas(at)gmail(dot)com>, alvherre <alvherre(at)commandprompt(dot)com>, Andrew Dunstan <andrew(at)dunslane(dot)net>, Peter Eisentraut <peter_e(at)gmx(dot)net>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: functional call named notation clashes with SQL feature
Date: 2010-06-05 02:07:12
Message-ID: AANLkTimn00fdGTNfu7udvXDAy0gKu4gbZ030_68Wzgtb@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, Jun 4, 2010 at 9:55 PM, Joseph Adams <joeyadams3(dot)14159(at)gmail(dot)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.

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Gnanakumar 2010-06-05 05:21:16 Re: PITR Recovery Question
Previous Message Greg Stark 2010-06-05 02:04:53 Re: recovery getting interrupted is not so unusual as it used to be