polymorphic SQL functions has a problem with domains

Поиск
Список
Период
Сортировка
От Pavel Stehule
Тема polymorphic SQL functions has a problem with domains
Дата
Msg-id CAFj8pRDX=q6rLZ+fCFO9oEVLFoL2eZ_PgmLR3mZ4wd5GKS+Wgw@mail.gmail.com
обсуждение исходный текст
Ответы Re: polymorphic SQL functions has a problem with domains
Список pgsql-hackers
Hello

I was informed about impossibility to use a polymorphic functions together with domain types

see

 create domain xx as numeric(15);

create or replace function g(anyelement, anyelement)
returns anyelement as
$$  select $1 + $2 $$
language sql immutable;

postgres=# select g(1::xx, 2::xx);
ERROR:  return type mismatch in function declared to return xx
DETAIL:  Actual return type is numeric.
CONTEXT:  SQL function "g" during inlining

is this bug?

Regards

Pavel Stehule

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