Add geometry/range functions to support BRIN inclusion
Alvaro Herrera <alvherre@alvh.no-ip.org>
Add geometry/range functions to support BRIN inclusion
This commit adds the following functions:
box(point) -> box
bound_box(box, box) -> box
inet_same_family(inet, inet) -> bool
inet_merge(inet, inet) -> cidr
range_merge(anyrange, anyrange) -> anyrange
The first of these is also used to implement a new assignment cast from
point to box.
These functions are the first part of a base to implement an "inclusion"
operator class for BRIN, for multidimensional data types.
Author: Emre Hasegeli
Reviewed by: Andreas Karlsson
Files
| Path | Change | +/− |
|---|---|---|
| doc/src/sgml/func.sgml | modified | +47 −0 |
| src/backend/utils/adt/geo_ops.c | modified | +39 −0 |
| src/backend/utils/adt/network.c | modified | +52 −0 |
| src/backend/utils/adt/rangetypes.c | modified | +41 −13 |
| src/include/catalog/catversion.h | modified | +1 −1 |
| src/include/catalog/pg_cast.h | modified | +1 −0 |
| src/include/catalog/pg_proc.h | modified | +10 −0 |
| src/include/utils/builtins.h | modified | +2 −0 |
| src/include/utils/geo_decls.h | modified | +2 −0 |
| src/include/utils/rangetypes.h | modified | +1 −0 |
| src/test/regress/expected/geometry_1.out | modified | +34 −0 |
| src/test/regress/expected/geometry_2.out | modified | +34 −0 |
| src/test/regress/expected/geometry.out | modified | +34 −0 |
| src/test/regress/expected/inet.out | modified | +28 −0 |
| src/test/regress/expected/rangetypes.out | modified | +19 −1 |
| src/test/regress/sql/geometry.sql | modified | +6 −0 |
| src/test/regress/sql/inet.sql | modified | +7 −0 |
| src/test/regress/sql/rangetypes.sql | modified | +5 −1 |