Re: WIP: default values for function parameters

From: "Pavel Stehule" <pavel(dot)stehule(at)gmail(dot)com>
To: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: "Bruce Momjian" <bruce(at)momjian(dot)us>, "Gregory Stark" <stark(at)enterprisedb(dot)com>, "Grzegorz Jaskiewicz" <gj(at)pointblue(dot)com(dot)pl>, "PostgreSQL Hackers" <pgsql-hackers(at)postgresql(dot)org>, "Peter Eisentraut" <peter_e(at)gmx(dot)net>
Subject: Re: WIP: default values for function parameters
Date: 2008-12-10 17:37:39
Message-ID: 162867790812100937t19039addwaf62c7b7d86ef98c@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

2008/12/10 Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>:
> "Pavel Stehule" <pavel(dot)stehule(at)gmail(dot)com> writes:
>> look again
>> select c as foo from tab ...
>> select fce(c as foo) from tab ...
>
>> when you use AS as param names specification, you change meaning of
>> some construct via used context?
>
> Uh, what's your point? AS changes the meaning too. For example in
>
> select foo, bar from (select c as foo, d as bar from ...) ss;
>
> we are using AS to specify the names seen by the outer select.
> This seems to me to be quite a close parallel to attaching names
> to function parameters.

no, no - you use AS for an change of some property of set c column
values - label. Isn't important if this is select, subselect. label is
metadata - it's related to data. This is using of AS. Maybe it's
different for me, because I am not native speaker, so I feeling SQL
more like artifical language than you. For you using AS is more less
formal - it's your natural language. So I am filling some border
between data names (labels) and parameter names.

next argument - if we accept AS for param names, then we introduce
nonconsistent behave with SQL/XML functions.

select xmlforest(c1, c2 as foo, c3) -- there foo isn't doesn't mean
"use it as param foo", so from this view is using AS very dificult
accaptable too.

regards
Pavel Stehule

>
> regards, tom lane
>

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2008-12-10 17:42:14 Re: WIP: default values for function parameters
Previous Message Tom Lane 2008-12-10 17:36:38 Re: cvs head initdb hangs on unixware