Re: transforms

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: transforms
Дата
Msg-id 135173.1745104378@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: transforms  (Chapman Flack <jcflack@acm.org>)
Ответы Re: transforms
Список pgsql-hackers
Oh, just in case this wasn't complicated enough already: what
to do with polymorphic arguments/results?

You could argue that

CREATE FUNCTION foo(anyelement) RETURNS anyelement
TRANSFORM FOR TYPE int
AS ...;

should mean that if the actual argument type is int, then the
mentioned transform should be applied to the input and result;
but if it's some other type then just do the normal conversions.

You could perhaps also argue that that's a bad idea.  I'm not sure.
It does make for very dynamic matching of transforms to arguments,
which feels dubious to me, but I can't put my finger on a bad
consequence.

We have not faced this issue in the in-core PLs because neither
plperl nor plpython allow polymorphic arguments/results.  (I'm
surprised that no one has yet wanted to fix that.)  But I will
bet that there are other PLs that do allow that, and if they
also implement transforms then there's probably precedent
out there already.

            regards, tom lane



В списке pgsql-hackers по дате отправления: