polymorphic SQL functions has a problem with domains - Mailing list pgsql-hackers

From Pavel Stehule
Subject polymorphic SQL functions has a problem with domains
Date
Msg-id CAFj8pRDX=q6rLZ+fCFO9oEVLFoL2eZ_PgmLR3mZ4wd5GKS+Wgw@mail.gmail.com
Whole thread Raw
Responses Re: polymorphic SQL functions has a problem with domains
List 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 by date:

Previous
From: Michael Meskes
Date:
Subject: Re: using arrays within structure in ECPG
Next
From: Tom Lane
Date:
Subject: Re: polymorphic SQL functions has a problem with domains