From: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
---|---|
To: | Rod Taylor <rbt(at)rbt(dot)ca> |
Cc: | Avi Schwartz <avi(at)CFFtechnologies(dot)com>, Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>, pgsql-sql(at)postgresql(dot)org |
Subject: | Re: generic return for functions |
Date: | 2003-06-01 15:46:47 |
Message-ID: | 26866.1054482407@sss.pgh.pa.us |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-sql |
Rod Taylor <rbt(at)rbt(dot)ca> writes:
>> thing that causes me some minor grief is the fact that currently you=20
>> cannot have default values to function parameters, a feature we use a=20
>> lot.
> fn(integer, integer, integer default 32)
> select fn(integer, integer); <- Third argument would be '32'?
> When PostgreSQL gets named parameters the above probably makes sense to
> add.
> A TODO item?
That isn't ever going to happen. We have enough difficulty resolving
overloaded functions as it is. If we couldn't even be sure how many
arguments there were supposed to be, it'd become completely intractable.
You can however achieve similar effects at the user level by adding
auxiliary functions: declare fn(int,int) as a one-line SQL function
that calls fn($1, $2, 32).
regards, tom lane
From | Date | Subject | |
---|---|---|---|
Next Message | Avi Schwartz | 2003-06-01 16:15:59 | Re: generic return for functions |
Previous Message | Avi Schwartz | 2003-06-01 15:21:36 | Re: generic return for functions |