Re: [HACKERS] Check constraint on domain over an array not executed for array literals

2009-11-13 Thread Heikki Linnakangas
Florian G. Pflug wrote: While trying to create a domain over an array type to enforce a certain shape or certain contents of an array (like the array being only one-dimensional or not containing NULLs), I've stumbled over what I believe to be a bug in postgresql 8.4 It seems that check

Re: [HACKERS] Check constraint on domain over an array not executed for array literals

2009-11-13 Thread Florian G. Pflug
Heikki Linnakangas wrote: Agreed, it's a bug. A simpler example is just: [snipped] Will this fix for this be included in 8.4.2 (or .3), or will it have to wait for 8.4 because it changes behavior? There's a special case in transformExpr function to handle the ARRAY[...]::arraytype construct,

Re: [HACKERS] Check constraint on domain over an array not executed for array literals

2009-11-13 Thread Heikki Linnakangas
Florian G. Pflug wrote: Heikki Linnakangas wrote: Agreed, it's a bug. A simpler example is just: [snipped] Will this fix for this be included in 8.4.2 (or .3), or will it have to wait for 8.4 because it changes behavior? It's a regression; 8.3 and earlier used to check the domain constraint

Re: [HACKERS] Check constraint on domain over an array not executed for array literals

2009-11-13 Thread Tom Lane
Heikki Linnakangas heikki.linnakan...@enterprisedb.com writes: Florian G. Pflug wrote: It seems that check constraints on domains are *not* executed for literals of the domain-over-array-type - in other words, for expressions like: array[...]::my-domain-over-array-type. There's a special

Re: [HACKERS] Check constraint on domain over an array not executed for array literals

2009-11-13 Thread Heikki Linnakangas
Tom Lane wrote: Hm. I concur that this special-case code is failing to consider the possibility that the target type is domain-over-array-type rather than just array-type. I think though that this patch is a bit of a kluge, because it delivers a mislabeled expression tree. The result of the

Re: [HACKERS] Check constraint on domain over an array not executed for array literals

2009-11-13 Thread Heikki Linnakangas
Heikki Linnakangas wrote: Tom Lane wrote: Hm. I concur that this special-case code is failing to consider the possibility that the target type is domain-over-array-type rather than just array-type. I think though that this patch is a bit of a kluge, because it delivers a mislabeled

[HACKERS] Check constraint on domain over an array not executed for array literals

2009-11-12 Thread Florian G. Pflug
Hi While trying to create a domain over an array type to enforce a certain shape or certain contents of an array (like the array being only one-dimensional or not containing NULLs), I've stumbled over what I believe to be a bug in postgresql 8.4 It seems that check constraints on domains are