Re: named parameters in SQL functions

Поиск
Список
Период
Сортировка
От Pavel Stehule
Тема Re: named parameters in SQL functions
Дата
Msg-id 162867790911151042r6b089e6aqc9882088647da05@mail.gmail.com
обсуждение исходный текст
Ответ на Re: named parameters in SQL functions  ("David E. Wheeler" <david@kineticode.com>)
Ответы Re: named parameters in SQL functions
Список pgsql-hackers
2009/11/15 David E. Wheeler <david@kineticode.com>:
> On Nov 15, 2009, at 10:19 AM, Greg Stark wrote:
>
>>> I like the special marker idea.  A '$' would be nice because its already in
>>> use for similar purposes, but I think that would lead to ambiguity with
>>> dollar quoting.
>>
>> I think that would be a big break with everything else and very
>> non-sql-ish. We don't use these in plpgsql and we don't use them
>> anywhere else in sql.
>
> *ahem* $1 *ahem*
>
>> Moreover you would still have conflicts possible because sql can quote
>> identifiers so people can have columns named "$foo". You would have a
>> weird syntactic detail where "$foo" would mean something different
>> than $foo even though they're both valid identifiers.
>
> Same with Foo and "Foo", no?
>
>> I'm not sure it wouldn't conflict with some drivers either. DBI uses
>> :foo and ? but I have a vague recollection some drivers did use $foo.
>
> I don't think that would come up, because the $vars are in the body of the function, not in a typical driver call.
>
> Personally, I like $var, but @var would be okay, and @@var is acceptable. But I'm JAPH, so my biases should be
obvious.

@var or @@var should be a break for people from MySQL. @var are r/w in
MySQL and @@var are global in T-SQL. So people could be confused.

Regards
Pavel

>
> Best,
>
> David
> --
> Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-hackers
>


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Heikki Linnakangas
Дата:
Сообщение: Re: Summary and Plan for Hot Standby
Следующее
От: Andrew Dunstan
Дата:
Сообщение: Re: patch - Report the schema along table name in a referential failure error message