Re: [HACKERS] Problem with CIDR data type restrictions

2004-10-14 Thread Bruce Momjian
Added to TODO: * Prevent inet cast to cidr if the unmasked bits are not zero, or zero bits --- Andrew Dunstan wrote: > > > Tom Lane wrote: > > >Bruce Momjian <[EMAIL PROTECTED]> writes: > > > > > >>N

Re: [HACKERS] Problem with CIDR data type restrictions

2004-10-08 Thread Andrew Dunstan
Tom Lane wrote: Bruce Momjian <[EMAIL PROTECTED]> writes: Not sure how serious this is since we have gotten few complaints about it but clearly it should be fixed. Personally I'm inclined to leave it for 8.1. The inet/cidr code is really designed around the assumption that these datatypes

Re: [HACKERS] Problem with CIDR data type restrictions

2004-10-08 Thread Tom Lane
Bruce Momjian <[EMAIL PROTECTED]> writes: > Not sure how we can fix this without modifying the system tables. We can't: the only possible fix is to make inet-to-cidr not be a binary compatible conversion but instead have an actual conversion function. IMO the other direction should probably not b

[HACKERS] Problem with CIDR data type restrictions

2004-10-08 Thread Bruce Momjian
Yesterday I applied a patch that fixed incorrect restriction checking on CIDR data. Our old code didn't check the last byte for non-zero values so '1.1.1.1/25'::cidr would be accepted but '1.1.1.1/24'::cidr would not. Both should be rejected as cidr types, though they are OK for inet. The new pr