Re: proposal: generic function, constructor function
От | Tom Lane |
---|---|
Тема | Re: proposal: generic function, constructor function |
Дата | |
Msg-id | 13166.1200692680@sss.pgh.pa.us обсуждение исходный текст |
Ответ на | Re: proposal: generic function, constructor function ("Pavel Stehule" <pavel.stehule@gmail.com>) |
Ответы |
Re: proposal: generic function, constructor function
Re: proposal: generic function, constructor function |
Список | pgsql-hackers |
"Pavel Stehule" <pavel.stehule@gmail.com> writes: > On 18/01/2008, Tom Lane <tgl@sss.pgh.pa.us> wrote: >> Can't you do that already with ANYELEMENT, or at the worst ANY? > I would to have independent parameters and move type checking to > function. Okay, then you want ANY. > Then I don't need register function exactly and then I can > have different numbers of arguments. The different-numbers-of-arguments bit is what I'm objecting to. Just register the function as foo(ANY), foo(ANY,ANY), foo(ANY,ANY,ANY), etc, and you're done without breaking anything else. > we can use partial unique index, if it is possible - I didn't test it. It's not --- partial indexes on system catalogs are not supported, and pg_proc is certainly one catalog that that restriction will never be relaxed for. (How you going to execute a predicate without doing function lookups?) I don't believe that the constraint could be expressed as a partial index predicate anyway --- how will you say that foo(...) and foo(int) conflict, but foo(int) and foo(int,int) don't? regards, tom lane
В списке pgsql-hackers по дате отправления: