Re: WIP: default values for function parameters - Mailing list pgsql-hackers

From Robert Haas
Subject Re: WIP: default values for function parameters
Date
Msg-id 603c8f070812131934x520f4692v83440d97e3cc2eed@mail.gmail.com
Whole thread Raw
In response to Re: WIP: default values for function parameters  ("Greg Stark" <stark@enterprisedb.com>)
List 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


pgsql-hackers by date:

Previous
From: Jeff Davis
Date:
Subject: Re: Sync Rep: First Thoughts on Code
Next
From: Tatsuo Ishii
Date:
Subject: Re: Sync Rep: First Thoughts on Code