Re: WIP: default values for function parameters

From: "Robert Haas" <robertmhaas(at)gmail(dot)com>
To: "Greg Stark" <stark(at)enterprisedb(dot)com>
Cc: "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>, "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 03:34:37
Message-ID: 603c8f070812131934x520f4692v83440d97e3cc2eed@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> The whole relabeling thing seems like a seriously silly idea. Why is
> it at all a shortcut to use "AS" instead of "," ?

Because a lot of times you don't want to relabel, so you omit the "AS
label" part altogether, and the label is deduced from the expression
itself. For example, I don't need to write:

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

I can just write:

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

...which is a a lot more compact when the number of arguments is large.

...Robert

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tatsuo Ishii 2008-12-14 04:31:12 Re: Sync Rep: First Thoughts on Code
Previous Message Jeff Davis 2008-12-14 03:33:13 Re: Sync Rep: First Thoughts on Code