Re: Calling PL functions with named parameters

From: Oliver Jowett <oliver(at)opencloud(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: David Fetter <david(at)fetter(dot)org>, PG Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Calling PL functions with named parameters
Date: 2004-08-13 23:18:18
Message-ID: 411D4C3A.8050108@opencloud.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Tom Lane wrote:

>>On a related note, it would also be nice to have default
>>parameters and some way to say to use them.
>
>
> That is fundamentally not ever going to happen, because it blows
> overloaded-function resolution out of the water: there is no way to
> choose whether "foo(42, 2.5)" matches foo(int, float) or
> foo(int, float, something-with-a-default). Let's try to limit our
> attention to something that might actually work.

C++ manages to solve this problem, although I can't remember the exact
mechanics (and C++ is usually not a good example to follow anyway ;)

How about just disallowing function signatures that cause ambiguity?
i.e. make f(t1,t2,default t3,default t4,..) lay claim to f(t1,t2),
f(t1,t2,t3), f(t1,t2,t3,t4) etc, and creation fails if any of those
signatures are already claimed by another function.

-O

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2004-08-13 23:29:43 Re: Re: We have got a serious problem with pg_clog/WAL synchronization
Previous Message Simon@2ndquadrant.com 2004-08-13 23:16:55 Re: Re: We have got a serious problem with pg_clog/WAL synchronization