polymorphic SQL functions has a problem with domains

From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: polymorphic SQL functions has a problem with domains
Date: 2014-04-02 15:07:42
Message-ID: CAFj8pRDX=q6rLZ+fCFO9oEVLFoL2eZ_PgmLR3mZ4wd5GKS+Wgw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2014-04-02 15:19:12 Re: polymorphic SQL functions has a problem with domains
Previous Message Michael Meskes 2014-04-02 14:59:34 Re: using arrays within structure in ECPG