4.1beta1: ANYARRAY disallowed for DOMAIN types which happen to be arrays

From: "J(dot) Greg Davidson" <greg(at)ngender(dot)net>
To: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: 4.1beta1: ANYARRAY disallowed for DOMAIN types which happen to be arrays
Date: 2011-05-09 22:25:03
Message-ID: 1304979903.14349.86.camel@shevek.puuhonua.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


E.1.2.2. Casting

* Tighten casting checks for domains based on arrays (Tom Lane)

When a domain is based on an array type,..., such a domain type
is no longer allowed to match an anyarray parameter of a
polymorphic function, except by explicitly downcasting it to the
base array type.

This will require me to add hundreds of casts to my code. I do not get
how this will "Tighten casting checks". It will certainly not tighten
my code! Could you explain how it is good to not be able to do array
operations with a type which is an array?

BTW: All of my DOMAINs which are array types exist because of
PostgreSQL's inability to infer array types for DOMAINs, so I
have lots of code like this:

CREATE DOMAIN foo_ids AS integer;
CREATE DOMAIN foo_id_arrays AS integer[];

I would love to be able to simply use foo_ids[] instead of
having to have the second DOMAIN foo_id_arrays.

If there is some value which I'm missing in the above "Tighten"ing,
perhaps it could be put in *after* PostgreSQL were given the ability
to understand foo_ids[] as an array of foo_ids.

Thanks,

_Greg

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Greg Smith 2011-05-09 22:33:13 Re: Why not install pgstattuple by default?
Previous Message J. Greg Davidson 2011-05-09 21:23:43 Server Programming Interface underspecified in 4.1beta1