Re: WIP: default values for function parameters

From: "Pavel Stehule" <pavel(dot)stehule(at)gmail(dot)com>
To: "Greg Stark" <stark(at)enterprisedb(dot)com>
Cc: "Robert Haas" <robertmhaas(at)gmail(dot)com>, "Dimitri Fontaine" <dfontaine(at)hi-media(dot)com>, "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>, "Peter Eisentraut" <peter_e(at)gmx(dot)net>, pgsql-hackers(at)postgresql(dot)org, "Michael Meskes" <meskes(at)postgresql(dot)org>, "David E(dot) Wheeler" <david(at)kineticode(dot)com>, "Heikki Linnakangas" <heikki(dot)linnakangas(at)enterprisedb(dot)com>, "Bruce Momjian" <bruce(at)momjian(dot)us>, "Grzegorz Jaskiewicz" <gj(at)pointblue(dot)com(dot)pl>
Subject: Re: WIP: default values for function parameters
Date: 2008-12-14 20:03:34
Message-ID: 162867790812141203l34a1c33dj6d8764e075ac23bd@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

2008/12/14 Greg Stark <stark(at)enterprisedb(dot)com>:
> On Sun, Dec 14, 2008 at 1:42 AM, Robert Haas <robertmhaas(at)gmail(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Heikki Linnakangas 2008-12-14 20:06:52 Re: Sync Rep: First Thoughts on Code
Previous Message Tom Lane 2008-12-14 19:58:03 Re: Re: [SQL] array_to_string(anyarray, text) that was working in 8.1 is not working in 8.3