Polymorphic types vs. domains

Started by Tom Laneabout 17 years ago8 messages
#1Tom Lane
tgl@sss.pgh.pa.us

The proximate cause of this complaint:
http://archives.postgresql.org/pgsql-general/2008-12/msg00283.php
seems to be that the polymorphic-type code doesn't consider a domain
over an enum type to match an ANYENUM function argument.

ISTM this is probably wrong: we need such a domain to act like its base
type for matching purposes. There is an analogous problem with a domain
over an array type failing to match ANYARRAY; conversely, such a domain
is considered to match ANYNONARRAY which it likely should not.

Comments? If this is agreed to be a bug, should we consider
back-patching it? (I'd vote not, I think, because the behavioral
change could conceivably break some apps that work now.)

regards, tom lane

#2David E. Wheeler
david@kineticode.com
In reply to: Tom Lane (#1)
Re: Polymorphic types vs. domains

On Dec 8, 2008, at 2:46 AM, Tom Lane wrote:

Comments?

+1

If this is agreed to be a bug, should we consider
back-patching it? (I'd vote not, I think, because the behavioral
change could conceivably break some apps that work now.)

+1

Best,

David

#3Greg Stark
greg.stark@enterprisedb.com
In reply to: David E. Wheeler (#2)
Re: Polymorphic types vs. domains

How would it break any apps? They would hve to be depending on passing
arrays as anynonarray? That seems unlikely.

On the other hand I don't see much reason to backpatch. It's not like
anyone is going to run into this problem unexpectedly on a running
system. It just doesn't seem like a back patchable bug fix.

--
Greg

On 8 Dec 2008, at 08:00, "David E. Wheeler" <david@kineticode.com>
wrote:

Show quoted text

On Dec 8, 2008, at 2:46 AM, Tom Lane wrote:

Comments?

+1

If this is agreed to be a bug, should we consider
back-patching it? (I'd vote not, I think, because the behavioral
change could conceivably break some apps that work now.)

+1

Best,

David

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

#4Tom Lane
tgl@sss.pgh.pa.us
In reply to: Greg Stark (#3)
Re: Polymorphic types vs. domains

Greg Stark <greg.stark@enterprisedb.com> writes:

How would it break any apps?

Well, this would change the set of possible matches for ambiguous
function calls. So it's not out of the question that you could get
ambiguous-function failures that didn't happen before.

regards, tom lane

#5Grzegorz Jaskiewicz
gj@pointblue.com.pl
In reply to: Tom Lane (#4)
Re: Polymorphic types vs. domains

To be honest, for me back patching would mean only that I don't have
to recompile, and resend binaries to clients, after 8.1->8.3 upgrade
(to utilize enums, and domains).
I don't think it would break any apps tho.

so in my case, obviously +1 +1 :)

#6Grzegorz Jaskiewicz
gj@pointblue.com.pl
In reply to: Grzegorz Jaskiewicz (#5)
Re: Polymorphic types vs. domains

any news on that front ?

#7Bruce Momjian
bruce@momjian.us
In reply to: Tom Lane (#1)
Re: Polymorphic types vs. domains

Where are we on this? I tested CVS and the problem still seems to
exist.

---------------------------------------------------------------------------

Tom Lane wrote:

The proximate cause of this complaint:
http://archives.postgresql.org/pgsql-general/2008-12/msg00283.php
seems to be that the polymorphic-type code doesn't consider a domain
over an enum type to match an ANYENUM function argument.

ISTM this is probably wrong: we need such a domain to act like its base
type for matching purposes. There is an analogous problem with a domain
over an array type failing to match ANYARRAY; conversely, such a domain
is considered to match ANYNONARRAY which it likely should not.

Comments? If this is agreed to be a bug, should we consider
back-patching it? (I'd vote not, I think, because the behavioral
change could conceivably break some apps that work now.)

regards, tom lane

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

--
Bruce Momjian <bruce@momjian.us> http://momjian.us
EnterpriseDB http://enterprisedb.com

+ If your life is a hard drive, Christ can be your backup. +

#8Bruce Momjian
bruce@momjian.us
In reply to: Tom Lane (#1)
Re: Polymorphic types vs. domains

Tom Lane wrote:

The proximate cause of this complaint:
http://archives.postgresql.org/pgsql-general/2008-12/msg00283.php
seems to be that the polymorphic-type code doesn't consider a domain
over an enum type to match an ANYENUM function argument.

ISTM this is probably wrong: we need such a domain to act like its base
type for matching purposes. There is an analogous problem with a domain
over an array type failing to match ANYARRAY; conversely, such a domain
is considered to match ANYNONARRAY which it likely should not.

Comments? If this is agreed to be a bug, should we consider
back-patching it? (I'd vote not, I think, because the behavioral
change could conceivably break some apps that work now.)

This has not been addressed yet.

--
Bruce Momjian <bruce@momjian.us> http://momjian.us
EnterpriseDB http://enterprisedb.com

+ If your life is a hard drive, Christ can be your backup. +