Re: WIP: default values for function parameters

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "David E(dot) Wheeler" <david(at)kineticode(dot)com>
Cc: 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>, "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-12 15:06:30
Message-ID: 5767.1229094390@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

"David E. Wheeler" <david(at)kineticode(dot)com> writes:
> Hrm. I can see that, I guess. In that case, though, I think I'd prefer
> the colon at the beginning of the parameter label:

> SELECT foo( :bar => 'ick', :baz => 'ack' );

That's ugly, and incompatible with ecpg syntax, and what's the redeeming
value anyway?

In any case, whichever side you put the colon on, Pavel's proposal for
adding => to it is a nonstarter --- he's ignoring the possibility that
=> is defined as a prefix operator.

Hmm ... actually, ecpg might be a problem here anyway. I know it has
special meaning for :name, but does it allow space between the colon
and the name? If it does then the colon syntax loses. If it doesn't
then you could do "name: value" as long as you were careful to leave
a space after the colon.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Simon Riggs 2008-12-12 15:06:49 Re: benchmarking the query planner
Previous Message David E. Wheeler 2008-12-12 15:03:34 Re: WIP: default values for function parameters