Re: WIP: default values for function parameters

From: "David E(dot) Wheeler" <david(at)kineticode(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: "Greg Stark" <stark(at)enterprisedb(dot)com>, "Robert Haas" <robertmhaas(at)gmail(dot)com>, "Dimitri Fontaine" <dfontaine(at)hi-media(dot)com>, "Peter Eisentraut" <peter_e(at)gmx(dot)net>, pgsql-hackers(at)postgresql(dot)org, "Michael Meskes" <meskes(at)postgresql(dot)org>, "Pavel Stehule" <pavel(dot)stehule(at)gmail(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 08:34:22
Message-ID: 426A6C94-0E76-4E14-99A7-6E4524D40062@kineticode.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Dec 14, 2008, at 6:55 AM, Tom Lane wrote:

>> The whole relabeling thing seems like a seriously silly idea.
>
> I wouldn't say that it's silly. What I do say is that it makes no
> sense
> to imagine that it would be used at the same time as named parameters.
> The entire point of something like XMLELEMENT is that it takes a
> list of
> undifferentiated parameters, which therefore do not need to have names
> so far as the function is concerned.

Perhaps not, but I have to say, looking at Robert's JSON example:

> SELECT json(r.foo AS foo, r.bar AS bar, r.baz AS baz, r.bletch AS
> quux) FROM rel r;

I would be pretty confused. It looks exactly like the proposed syntax
for named parameters. So while syntactically they may never be used
together, there's a semantic mismatch, IMHO.

Best,

David

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Mark Mielke 2008-12-14 08:46:27 Re: Sync Rep: First Thoughts on Code
Previous Message James Mansion 2008-12-14 08:25:59 Re: Mostly Harmless: Welcoming our C++ friends