Re: transforms

Поиск
Список
Период
Сортировка
От Chapman Flack
Тема Re: transforms
Дата
Msg-id 68043280.1010305@acm.org
обсуждение исходный текст
Ответ на Re: transforms  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: transforms
Список pgsql-hackers
On 04/19/25 19:12, Tom Lane wrote:
> 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.

My position would be that it's not a bad idea. It would be consistent
and unastonishing.

A PL that uses a staging approach has probably precomputed and cached
a good deal of information, including what transforms are requested and
what parameter positions are polymorphic if any, and only needs to check
those when specializing, and funccache can preserve those results too.

Regards,
-Chap



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