On 03.06.2016 02:02, Rod Taylor wrote:
Sorry, the problem is more difficult than I originally expected:(
Attached patch passes all regression tests and correctly handle conversion of arrays.
But constraints are not checked for table columns. I failed to locate place where this check should be inserted...
Originally I was mostly interested in domains as kind of typedefs: convenient way to assign type to some particular kind of columns,
for example object reference used in ORM.
There are two main goals of using domain here:
1. Be able to easily change representation of object identifier, for example from integer to bigint.
2. Detect all columns containing references (distinguish them from columns containing just normal integers).
I do not see any other mechanism in PostgreSQL which can address this problem (for example user defined type can not help here).
I wonder if it is possible to support arrays of domain which do not have constraints?
Or such partial support is worser than prohibiting arrays of domains at all?
--
Konstantin Knizhnik
Postgres Professional: http://www.postgrespro.com
The Russian Postgres Company