Re: WIP: default values for function parameters

Поиск
Список
Период
Сортировка
От Robert Haas
Тема Re: WIP: default values for function parameters
Дата
Msg-id 603c8f070812130922v521ec2c1s77e2602cac4e2b35@mail.gmail.com
обсуждение исходный текст
Ответ на Re: WIP: default values for function parameters  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
> 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.

It's not ambiguous unless for some reason you wanted to support doing
both of those things at the same time, but I'm having a hard time
coming up with a realistic use case for that.  Still, I think we
probably do want to at least leave the door open to do both things at
different times.  For the XMLELEMENT-type case, "value AS label" seems
far superior to "label: value", so if you're going to pick one syntax
for both things, it should be that one.

Alternatively, using "label: value" for identifying which parameter is
intended to get the value and "value AS label" for relabelling seems
OK too, though your argument about standards-compliance is a valid
one.

...Robert


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

Предыдущее
От: Markus Wanner
Дата:
Сообщение: Re: Sync Rep: First Thoughts on Code
Следующее
От: Tom Lane
Дата:
Сообщение: Stats target increase vs compute_tsvector_stats()