Polymorphic types vs. domains

Lists: pgsql-hackers
From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-hackers(at)postgreSQL(dot)org
Subject: Polymorphic types vs. domains
Date: 2008-12-08 01:46:13
Message-ID: 4887.1228700773@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

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


From: "David E(dot) Wheeler" <david(at)kineticode(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-hackers(at)postgreSQL(dot)org
Subject: Re: Polymorphic types vs. domains
Date: 2008-12-08 08:00:49
Message-ID: AA63D5AB-4F9C-4B0E-BC29-8994C783E4D5@kineticode.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

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


From: Greg Stark <greg(dot)stark(at)enterprisedb(dot)com>
To: "David E(dot) Wheeler" <david(at)kineticode(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Polymorphic types vs. domains
Date: 2008-12-08 09:20:53
Message-ID: BBEC40FD-BCC9-4C5F-BBDC-E72E045E7390@enterprisedb.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

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(at)kineticode(dot)com>
wrote:

> 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(at)postgresql(dot)org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-hackers


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Greg Stark <greg(dot)stark(at)enterprisedb(dot)com>
Cc: "David E(dot) Wheeler" <david(at)kineticode(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Polymorphic types vs. domains
Date: 2008-12-08 13:04:41
Message-ID: 22954.1228741481@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Greg Stark <greg(dot)stark(at)enterprisedb(dot)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


From: Grzegorz Jaskiewicz <gj(at)pointblue(dot)com(dot)pl>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Greg Stark <greg(dot)stark(at)enterprisedb(dot)com>, "David E(dot) Wheeler" <david(at)kineticode(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Polymorphic types vs. domains
Date: 2008-12-08 14:44:17
Message-ID: 651F5EE1-5C21-413D-A64B-2991BFA57B69@pointblue.com.pl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

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 :)


From: Grzegorz Jaskiewicz <gj(at)pointblue(dot)com(dot)pl>
To: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Polymorphic types vs. domains
Date: 2008-12-12 15:56:59
Message-ID: 1BE5D4AF-002B-43CA-8955-36187C722B5B@pointblue.com.pl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

any news on that front ?


From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Polymorphic types vs. domains
Date: 2009-01-20 17:08:55
Message-ID: 200901201708.n0KH8uR03639@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers


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(at)postgresql(dot)org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-hackers

--
Bruce Momjian <bruce(at)momjian(dot)us> http://momjian.us
EnterpriseDB http://enterprisedb.com

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


From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Polymorphic types vs. domains
Date: 2009-02-04 19:29:29
Message-ID: 200902041929.n14JTTs07736@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

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(at)momjian(dot)us> http://momjian.us
EnterpriseDB http://enterprisedb.com

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