Re: Function with DEFAULT arguments - Mailing list pgsql-general

From Scott Bailey
Subject Re: Function with DEFAULT arguments
Date
Msg-id 4B9A74DF.8050907@comcast.net
Whole thread Raw
In response to Re: Function with DEFAULT arguments  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Function with DEFAULT arguments  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-general
Tom Lane wrote:
> "dario.ber@libero.it" <dario.ber@libero.it> writes:
>> I'm trying to use the DEFAULT option to pass parameters to the arguments of a
>> function.
>> When I call that function, how can I change the default value of some
>> arguments and leave as default the value of other arguments?
>
> You can only omit arguments from right to left, so basically what this
> requires is some foresight while choosing the function's argument order.
>
>             regards, tom lane
>

What do you think about allowing 'default' as a parameter the way we do
when inserting a record?

So if a param has a default value, the function call may look like:

SELECT foo(default, 'hello', 43)


Scott Bailey

pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: Function with DEFAULT arguments
Next
From: Domenico Rotiroti
Date:
Subject: [RFC] Comments on PostPic project