Re: Problem with CIDR data type restrictions - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Problem with CIDR data type restrictions
Date
Msg-id 13609.1097253423@sss.pgh.pa.us
Whole thread Raw
In response to Problem with CIDR data type restrictions  (Bruce Momjian <pgman@candle.pha.pa.us>)
Responses Re: Problem with CIDR data type restrictions
List pgsql-hackers
Bruce Momjian <pgman@candle.pha.pa.us> 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 be straight binary
compatible either; instead it ought to flip the bit that says "I'm a
CIDR value".

So fixing this requires a couple of new functions and some pg_cast
changes.  Since we already forced initdb for beta4, there is a window of
opportunity to do that without any extra pain for beta testers, but the
fix would have to happen *now*.

> 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 are
interchangeable, and I suspect that enforcing a stronger distinction
will actually take much more wide-ranging changes than just this.
Do all of the functions on inet/cidr take care to deliver a value that
is both correctly marked and declared as the correct type?  I doubt it.
It needs some thought not just a band-aid ...
        regards, tom lane


pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: APR 1.0 released
Next
From: Andrew Dunstan
Date:
Subject: Re: Log line prefix on win32