Re: WIP: default values for function parameters

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: WIP: default values for function parameters
Дата
Msg-id 26519.1229184353@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: WIP: default values for function parameters  (Dimitri Fontaine <dfontaine@hi-media.com>)
Ответы Re: WIP: default values for function parameters  ("David E. Wheeler" <david@kineticode.com>)
Re: WIP: default values for function parameters  ("Robert Haas" <robertmhaas@gmail.com>)
Re: WIP: default values for function parameters  (Dimitri Fontaine <dfontaine@hi-media.com>)
Список pgsql-hackers
Dimitri Fontaine <dfontaine@hi-media.com> writes:
> Le 13 d�c. 08 � 11:39, Peter Eisentraut a �crit :
>> I personally thought that AS was a better idea.

> It seems some people want to be able to overload some default  
> parameters (but not others) and at the same time alias them to some  
> new label. I'm not sure I understand it all, but it seems an example  
> of it would be like:
>    SELECT xml_function(a, b: 'foo' AS bar);

> If this is what some people want when all the spare parts are bound  
> together, we don't have the option to use AS for both the meanings.

I personally agree that AS seems more SQL-ish, but that's in the eye
of the beholder.

The argument about ambiguity in XMLELEMENT is bogus becase XMLELEMENT
doesn't (and won't) have named parameters.  But it is true that
XMLELEMENT is doing something subtly different with the AS clause than
what a named parameter would do; so you could argue that there's a
potential for user confusion there.

However, after looking at the precedent of XMLELEMENT, it's hard to deny
that if the SQL committee ever chose to standardize named parameters,
AS is what they would use.  The chances that ":" would become the
standard are negligible --- that's not the sort of syntax they like
to standardize.
        regards, tom lane


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

Предыдущее
От: Simon Riggs
Дата:
Сообщение: Re: Sync Rep: First Thoughts on Code
Следующее
От: Bruce Momjian
Дата:
Сообщение: Re: WIP: default values for function parameters