Re: Function with DEFAULT arguments

From: Scott Bailey <artacus(at)comcast(dot)net>
To:
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Function with DEFAULT arguments
Date: 2010-03-12 17:07:43
Message-ID: 4B9A74DF.8050907@comcast.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Tom Lane wrote:
> "dario(dot)ber(at)libero(dot)it" <dario(dot)ber(at)libero(dot)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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Bruce Momjian 2010-03-12 17:13:48 Re: [GENERAL] trouble with to_char('L')
Previous Message Tom Lane 2010-03-12 16:51:40 Re: Function with DEFAULT arguments