Re: WIP: default values for function parameters

Поиск
Список
Период
Сортировка
От Pavel Stehule
Тема Re: WIP: default values for function parameters
Дата
Msg-id 162867790812141203l34a1c33dj6d8764e075ac23bd@mail.gmail.com
обсуждение исходный текст
Ответ на Re: WIP: default values for function parameters  ("Greg Stark" <stark@enterprisedb.com>)
Ответы Re: WIP: default values for function parameters  (Peter Eisentraut <peter_e@gmx.net>)
Список pgsql-hackers
2008/12/14 Greg Stark <stark@enterprisedb.com>:
> On Sun, Dec 14, 2008 at 1:42 AM, Robert Haas <robertmhaas@gmail.com> wrote:
>>> What if relabeling support were to spread some more?
>>
>> The only example I can think of besides XML is JSON.  There might be a
>> few more.  Basically, relabelling is a handy shortcut when you are
>> serializing data and want to avoid specifying a list of columns and an
>> (almost) identical list of labels.
>
> The whole relabeling thing seems like a seriously silly idea. Why is
> it at all a shortcut to use "AS" instead of "," ? The relabeling adds
> zero actual expressiveness, it just makes a fancy way to pass an
> argument.
>
>

Because AS is signal for collecting column (or label) names.

I thing so we should use "AS" as Tom's proposal, together with SQL/XML
functionality.

It's only idea: default behave is using as for param name specification,

seconf with flag maybe labeled allows using AS in SQL/XML behave

But this syntax don't allow use this feature together (it is maybe enought).\

create function json(variadic labeled values int[]) ...

Pavel


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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Re: [SQL] array_to_string(anyarray, text) that was working in 8.1 is not working in 8.3
Следующее
От: Heikki Linnakangas
Дата:
Сообщение: Re: Sync Rep: First Thoughts on Code