Re: proposal: new polymorphic types - commontype and commontypearray
Tom Lane <tgl@sss.pgh.pa.us>
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Pavel Stehule <pavel.stehule@gmail.com>
Cc: Dmitry Dolgov <9erthalion6@gmail.com>, Greg Stark <stark@mit.edu>,
David Steele <david@pgmasters.net>,
Robert Haas <robertmhaas@gmail.com>,
PostgreSQL Hackers <pgsql-hackers@postgresql.org>
Date: 2020-03-18T17:09:04Z
Lists: 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
Commits
-
Introduce "anycompatible" family of polymorphic types.
- 24e2885ee304 13.0 landed
-
Refactor our checks for valid function and aggregate signatures.
- e6c178b5b73a 13.0 landed
-
Rearrange pseudotypes.c to get rid of duplicative code.
- 87c9c2571c81 13.0 landed