Re: WIP: default values for function parameters

Поиск
Список
Период
Сортировка
От Robert Haas
Тема Re: WIP: default values for function parameters
Дата
Msg-id 603c8f070812131742w31dc7372oca6b7c4f23c0e936@mail.gmail.com
обсуждение исходный текст
Ответ на Re: WIP: default values for function parameters  (Dimitri Fontaine <dfontaine@hi-media.com>)
Ответы Re: WIP: default values for function parameters  ("Greg Stark" <stark@enterprisedb.com>)
Список pgsql-hackers
> 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.  Otherwise, it's not good for much.I think we should eventually aim to support
user-definedfunctions
 
that work like this, because people will forever be inventing new ways
to serialize things and it'd be nice not to have to recompile to add
support for a new one.

I suppose you might want to do something like this:

html_input(foo) returns <input name='foo' type='text' value='[...value
of foo...]'>
html_input(foo AS bar) returns <input name='foo' type='text'
value='[...value of foo...]'>
html_input(foo, type: hidden) returns <input name='foo' type='hidden'
value='[...value of foo...]'>

...Robert


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

Предыдущее
От: "Joshua D. Drake"
Дата:
Сообщение: Re: Future request: BgBouncer && "cache lookup failed for function": Auto recache function.
Следующее
От: "Greg Stark"
Дата:
Сообщение: Re: WIP: default values for function parameters