Re: WIP: default values for function parameters

From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(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-11 14:42:59
Message-ID: 200812111442.mBBEgx606731@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Pavel Stehule wrote:
> 2008/12/10 Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>:
> > 2008/12/10 Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>:
> >> "Pavel Stehule" <pavel(dot)stehule(at)gmail(dot)com> writes:
> >>> 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",
> >>
> >> It could be read as meaning that, I think.
> >>
> >> In any case, I'm not wedded to using AS for this, and am happy to
> >> consider other suggestions.
>
> what do you thing about?
>
> select fce(p1,p2,p3, SET paramname1 = val, paramname2 = val)
>
> example
> select dosome(10,20,30, SET flaga = true, flagb = false)

I think AS read more naturally because you expect the parameter to come
first, not the SET keyword.

--
Bruce Momjian <bruce(at)momjian(dot)us> http://momjian.us
EnterpriseDB http://enterprisedb.com

+ If your life is a hard drive, Christ can be your backup. +

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Zeugswetter Andreas OSB sIT 2008-12-11 14:45:45 RE: [HACKERS] Updates of SE-PostgreSQL 8.4devel patches (r1268)
Previous Message Heikki Linnakangas 2008-12-11 14:39:59 Re: visibility maps