Re: proposal: new polymorphic types - commontype and commontypearray - Mailing list pgsql-hackers

From Tom Lane
Subject Re: proposal: new polymorphic types - commontype and commontypearray
Date
Msg-id 10776.1584551344@sss.pgh.pa.us
Whole thread Raw
In response to Re: proposal: new polymorphic types - commontype and commontypearray  (Pavel Stehule <pavel.stehule@gmail.com>)
Responses Re: proposal: new polymorphic types - commontype and commontypearray  (Pavel Stehule <pavel.stehule@gmail.com>)
List pgsql-hackers
Pavel Stehule <pavel.stehule@gmail.com> writes:
> st 18. 3. 2020 v 17:54 odesílatel Tom Lane <tgl@sss.pgh.pa.us> napsal:
>> No, because if you've got that alongside foo2(anycompatible,
>> anycompatible) then your queries will fail due to both functions
>> matching anything that's promotable to text.

> It is working for anyelement

[ pokes at that... ]  Hm, looks like you're getting away with that
because of the preference for functions taking preferred types.
Seems pretty shaky to me though --- you can probably invent
cases that will throw 'ambiguous function' if you try a bit harder.
In any case, I don't think users will understand why they have to
write two versions of the same function.

            regards, tom lane



pgsql-hackers by date:

Previous
From: Andres Freund
Date:
Subject: Re: Berserk Autovacuum (let's save next Mandrill)
Next
From: Alvaro Herrera
Date:
Subject: Re: type of some table storage params on doc