Clean up the INET-vs-CIDR situation. Get rid of the internal is_cidr flag
Tom Lane <tgl@sss.pgh.pa.us>
Clean up the INET-vs-CIDR situation. Get rid of the internal is_cidr flag and rely exclusively on the SQL type system to tell the difference between the types. Prevent creation of invalid CIDR values via casting from INET or set_masklen() --- both of these operations now silently zero any bits to the right of the netmask. Remove duplicate CIDR comparison operators, letting the type rely on the INET operators instead.
Files
| Path | Change | +/− |
|---|---|---|
| doc/src/sgml/func.sgml | modified | +32 −4 |
| src/backend/optimizer/path/indxpath.c | modified | +3 −19 |
| src/backend/utils/adt/network.c | modified | +196 −79 |
| src/include/catalog/catversion.h | modified | +2 −2 |
| src/include/catalog/pg_amop.h | modified | +7 −7 |
| src/include/catalog/pg_cast.h | modified | +2 −2 |
| src/include/catalog/pg_operator.h | modified | +2 −18 |
| src/include/catalog/pg_proc.h | modified | +12 −6 |
| src/include/utils/builtins.h | modified | +5 −2 |
| src/include/utils/inet.h | modified | +1 −2 |
| src/test/regress/expected/opr_sanity.out | modified | +4 −1 |
| src/test/regress/sql/opr_sanity.sql | modified | +3 −0 |