Re: Calling PL functions with named parameters - Mailing list pgsql-hackers

From Jim C. Nasby
Subject Re: Calling PL functions with named parameters
Date
Msg-id 20040813225812.GI87347@decibel.org
Whole thread Raw
In response to Re: Calling PL functions with named parameters  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Calling PL functions with named parameters
List pgsql-hackers
On Fri, Aug 13, 2004 at 06:22:25PM -0400, 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.
Actually, it is possible because Oracle does it. Presumably they treat a
function with defaults as being the equivalent number of overloaded
functions when functions are created, to ensure it can always resolve
what function to call.

IOW, their function resolution code treats a(int, int default 0) as
being equivalent to a(int) and a(int, int).
-- 
Jim C. Nasby, Database Consultant               decibel@decibel.org 
Give your computer some brain candy! www.distributed.net Team #1828

Windows: "Where do you want to go today?"
Linux: "Where do you want to go tomorrow?"
FreeBSD: "Are you guys coming, or what?"


pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: Postgres development model
Next
From: "Simon@2ndquadrant.com"
Date:
Subject: Re: Re: We have got a serious problem with pg_clog/WAL synchronization