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

From Tom Lane
Subject Re: Calling PL functions with named parameters
Date
Msg-id 809.1092453156@sss.pgh.pa.us
Whole thread Raw
In response to Re: Calling PL functions with named parameters  (Robert Treat <xzilla@users.sourceforge.net>)
List pgsql-hackers
Robert Treat <xzilla@users.sourceforge.net> writes:
> Would it be any better to allow
> SELECT blah(1,DEFAULT); 

Not a lot.  If there is more than one 2-parameter blah(), how do you
pick?  The DEFAULT gives you no clue at all about the type of the
second parameter...

I think if we wanted to do something like this, the right way would be
that "create function foo(f1 text, f2 int default 42)" implicitly
creates a second function "foo(f1 text)", and we make no change to the
matching rules.  But managing this seems mighty messy --- for instance,
we don't presently have any concept of hidden or second-class-citizen
entries in pg_proc, but we'd have to create one to keep the implicitly
created functions out of your face in pg_dump, psql \df, etc.  And
again, it's not really giving you anything you can't have today.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: [Fwd: Re: [pgsql-hackers-win32] Import from Linux to
Next
From: Bruce Momjian
Date:
Subject: Re: PITR on Windows?