Re: functional call named notation clashes with SQL feature

Поиск
Список
Период
Сортировка
От Joseph Adams
Тема Re: functional call named notation clashes with SQL feature
Дата
Msg-id AANLkTimn00fdGTNfu7udvXDAy0gKu4gbZ030_68Wzgtb@mail.gmail.com
обсуждение исходный текст
Ответ на Re: functional call named notation clashes with SQL feature  (Joseph Adams <joeyadams3.14159@gmail.com>)
Список 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 по дате отправления:

Предыдущее
От: Greg Stark
Дата:
Сообщение: Re: recovery getting interrupted is not so unusual as it used to be
Следующее
От: Tom Lane
Дата:
Сообщение: Re: functional call named notation clashes with SQL feature