Re: Calling PL functions with named parameters

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Calling PL functions with named parameters
Дата
Msg-id 809.1092453156@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Calling PL functions with named parameters  (Robert Treat <xzilla@users.sourceforge.net>)
Список 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 по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: [Fwd: Re: [pgsql-hackers-win32] Import from Linux to
Следующее
От: Bruce Momjian
Дата:
Сообщение: Re: PITR on Windows?