1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-27 12:41:57 +03:00

Rename contrib contains/contained-by operators to @> and <@, per discussion.

This commit is contained in:
Tom Lane
2006-09-10 17:36:52 +00:00
parent ba920e1c91
commit 684ad6a92f
36 changed files with 1290 additions and 1111 deletions

View File

@ -627,91 +627,91 @@ SELECT '[(-1,-1,-1),(1,1,1)]'::cube && '[(2,1,1),(2,2,2)]'::cube AS bool;
-- "contained in" (the left operand is the cube entirely enclosed by
-- the right operand):
--
SELECT '0'::cube ~ '0'::cube AS bool;
SELECT '0'::cube <@ '0'::cube AS bool;
bool
------
t
(1 row)
SELECT '0,0,0'::cube ~ '0,0,0'::cube AS bool;
SELECT '0,0,0'::cube <@ '0,0,0'::cube AS bool;
bool
------
t
(1 row)
SELECT '0,0'::cube ~ '0,0,1'::cube AS bool;
SELECT '0,0'::cube <@ '0,0,1'::cube AS bool;
bool
------
t
(1 row)
SELECT '0,0,0'::cube ~ '0,0,1'::cube AS bool;
SELECT '0,0,0'::cube <@ '0,0,1'::cube AS bool;
bool
------
f
(1 row)
SELECT '1,0,0'::cube ~ '0,0,1'::cube AS bool;
SELECT '1,0,0'::cube <@ '0,0,1'::cube AS bool;
bool
------
f
(1 row)
SELECT '(1,0,0),(0,0,1)'::cube ~ '(1,0,0),(0,0,1)'::cube AS bool;
SELECT '(1,0,0),(0,0,1)'::cube <@ '(1,0,0),(0,0,1)'::cube AS bool;
bool
------
t
(1 row)
SELECT '(1,0,0),(0,0,1)'::cube ~ '(-1,-1,-1),(1,1,1)'::cube AS bool;
SELECT '(1,0,0),(0,0,1)'::cube <@ '(-1,-1,-1),(1,1,1)'::cube AS bool;
bool
------
t
(1 row)
SELECT '(1,0,0),(0,0,1)'::cube ~ '(-1,-1,-1,-1),(1,1,1,1)'::cube AS bool;
SELECT '(1,0,0),(0,0,1)'::cube <@ '(-1,-1,-1,-1),(1,1,1,1)'::cube AS bool;
bool
------
t
(1 row)
SELECT '0'::cube ~ '(-1),(1)'::cube AS bool;
SELECT '0'::cube <@ '(-1),(1)'::cube AS bool;
bool
------
t
(1 row)
SELECT '1'::cube ~ '(-1),(1)'::cube AS bool;
SELECT '1'::cube <@ '(-1),(1)'::cube AS bool;
bool
------
t
(1 row)
SELECT '-1'::cube ~ '(-1),(1)'::cube AS bool;
SELECT '-1'::cube <@ '(-1),(1)'::cube AS bool;
bool
------
t
(1 row)
SELECT '(-1),(1)'::cube ~ '(-1),(1)'::cube AS bool;
SELECT '(-1),(1)'::cube <@ '(-1),(1)'::cube AS bool;
bool
------
t
(1 row)
SELECT '(-1),(1)'::cube ~ '(-1,-1),(1,1)'::cube AS bool;
SELECT '(-1),(1)'::cube <@ '(-1,-1),(1,1)'::cube AS bool;
bool
------
t
(1 row)
SELECT '(-2),(1)'::cube ~ '(-1),(1)'::cube AS bool;
SELECT '(-2),(1)'::cube <@ '(-1),(1)'::cube AS bool;
bool
------
f
(1 row)
SELECT '(-2),(1)'::cube ~ '(-1,-1),(1,1)'::cube AS bool;
SELECT '(-2),(1)'::cube <@ '(-1,-1),(1,1)'::cube AS bool;
bool
------
f
@ -720,91 +720,91 @@ SELECT '(-2),(1)'::cube ~ '(-1,-1),(1,1)'::cube AS bool;
-- "contains" (the left operand is the cube that entirely encloses the
-- right operand)
--
SELECT '0'::cube @ '0'::cube AS bool;
SELECT '0'::cube @> '0'::cube AS bool;
bool
------
t
(1 row)
SELECT '0,0,0'::cube @ '0,0,0'::cube AS bool;
SELECT '0,0,0'::cube @> '0,0,0'::cube AS bool;
bool
------
t
(1 row)
SELECT '0,0,1'::cube @ '0,0'::cube AS bool;
SELECT '0,0,1'::cube @> '0,0'::cube AS bool;
bool
------
t
(1 row)
SELECT '0,0,1'::cube @ '0,0,0'::cube AS bool;
SELECT '0,0,1'::cube @> '0,0,0'::cube AS bool;
bool
------
f
(1 row)
SELECT '0,0,1'::cube @ '1,0,0'::cube AS bool;
SELECT '0,0,1'::cube @> '1,0,0'::cube AS bool;
bool
------
f
(1 row)
SELECT '(1,0,0),(0,0,1)'::cube @ '(1,0,0),(0,0,1)'::cube AS bool;
SELECT '(1,0,0),(0,0,1)'::cube @> '(1,0,0),(0,0,1)'::cube AS bool;
bool
------
t
(1 row)
SELECT '(-1,-1,-1),(1,1,1)'::cube @ '(1,0,0),(0,0,1)'::cube AS bool;
SELECT '(-1,-1,-1),(1,1,1)'::cube @> '(1,0,0),(0,0,1)'::cube AS bool;
bool
------
t
(1 row)
SELECT '(-1,-1,-1,-1),(1,1,1,1)'::cube @ '(1,0,0),(0,0,1)'::cube AS bool;
SELECT '(-1,-1,-1,-1),(1,1,1,1)'::cube @> '(1,0,0),(0,0,1)'::cube AS bool;
bool
------
t
(1 row)
SELECT '(-1),(1)'::cube @ '0'::cube AS bool;
SELECT '(-1),(1)'::cube @> '0'::cube AS bool;
bool
------
t
(1 row)
SELECT '(-1),(1)'::cube @ '1'::cube AS bool;
SELECT '(-1),(1)'::cube @> '1'::cube AS bool;
bool
------
t
(1 row)
SELECT '(-1),(1)'::cube @ '-1'::cube AS bool;
SELECT '(-1),(1)'::cube @> '-1'::cube AS bool;
bool
------
t
(1 row)
SELECT '(-1),(1)'::cube @ '(-1),(1)'::cube AS bool;
SELECT '(-1),(1)'::cube @> '(-1),(1)'::cube AS bool;
bool
------
t
(1 row)
SELECT '(-1,-1),(1,1)'::cube @ '(-1),(1)'::cube AS bool;
SELECT '(-1,-1),(1,1)'::cube @> '(-1),(1)'::cube AS bool;
bool
------
t
(1 row)
SELECT '(-1),(1)'::cube @ '(-2),(1)'::cube AS bool;
SELECT '(-1),(1)'::cube @> '(-2),(1)'::cube AS bool;
bool
------
f
(1 row)
SELECT '(-1,-1),(1,1)'::cube @ '(-2),(1)'::cube AS bool;
SELECT '(-1,-1),(1,1)'::cube @> '(-2),(1)'::cube AS bool;
bool
------
f

View File

@ -627,91 +627,91 @@ SELECT '[(-1,-1,-1),(1,1,1)]'::cube && '[(2,1,1),(2,2,2)]'::cube AS bool;
-- "contained in" (the left operand is the cube entirely enclosed by
-- the right operand):
--
SELECT '0'::cube ~ '0'::cube AS bool;
SELECT '0'::cube <@ '0'::cube AS bool;
bool
------
t
(1 row)
SELECT '0,0,0'::cube ~ '0,0,0'::cube AS bool;
SELECT '0,0,0'::cube <@ '0,0,0'::cube AS bool;
bool
------
t
(1 row)
SELECT '0,0'::cube ~ '0,0,1'::cube AS bool;
SELECT '0,0'::cube <@ '0,0,1'::cube AS bool;
bool
------
t
(1 row)
SELECT '0,0,0'::cube ~ '0,0,1'::cube AS bool;
SELECT '0,0,0'::cube <@ '0,0,1'::cube AS bool;
bool
------
f
(1 row)
SELECT '1,0,0'::cube ~ '0,0,1'::cube AS bool;
SELECT '1,0,0'::cube <@ '0,0,1'::cube AS bool;
bool
------
f
(1 row)
SELECT '(1,0,0),(0,0,1)'::cube ~ '(1,0,0),(0,0,1)'::cube AS bool;
SELECT '(1,0,0),(0,0,1)'::cube <@ '(1,0,0),(0,0,1)'::cube AS bool;
bool
------
t
(1 row)
SELECT '(1,0,0),(0,0,1)'::cube ~ '(-1,-1,-1),(1,1,1)'::cube AS bool;
SELECT '(1,0,0),(0,0,1)'::cube <@ '(-1,-1,-1),(1,1,1)'::cube AS bool;
bool
------
t
(1 row)
SELECT '(1,0,0),(0,0,1)'::cube ~ '(-1,-1,-1,-1),(1,1,1,1)'::cube AS bool;
SELECT '(1,0,0),(0,0,1)'::cube <@ '(-1,-1,-1,-1),(1,1,1,1)'::cube AS bool;
bool
------
t
(1 row)
SELECT '0'::cube ~ '(-1),(1)'::cube AS bool;
SELECT '0'::cube <@ '(-1),(1)'::cube AS bool;
bool
------
t
(1 row)
SELECT '1'::cube ~ '(-1),(1)'::cube AS bool;
SELECT '1'::cube <@ '(-1),(1)'::cube AS bool;
bool
------
t
(1 row)
SELECT '-1'::cube ~ '(-1),(1)'::cube AS bool;
SELECT '-1'::cube <@ '(-1),(1)'::cube AS bool;
bool
------
t
(1 row)
SELECT '(-1),(1)'::cube ~ '(-1),(1)'::cube AS bool;
SELECT '(-1),(1)'::cube <@ '(-1),(1)'::cube AS bool;
bool
------
t
(1 row)
SELECT '(-1),(1)'::cube ~ '(-1,-1),(1,1)'::cube AS bool;
SELECT '(-1),(1)'::cube <@ '(-1,-1),(1,1)'::cube AS bool;
bool
------
t
(1 row)
SELECT '(-2),(1)'::cube ~ '(-1),(1)'::cube AS bool;
SELECT '(-2),(1)'::cube <@ '(-1),(1)'::cube AS bool;
bool
------
f
(1 row)
SELECT '(-2),(1)'::cube ~ '(-1,-1),(1,1)'::cube AS bool;
SELECT '(-2),(1)'::cube <@ '(-1,-1),(1,1)'::cube AS bool;
bool
------
f
@ -720,91 +720,91 @@ SELECT '(-2),(1)'::cube ~ '(-1,-1),(1,1)'::cube AS bool;
-- "contains" (the left operand is the cube that entirely encloses the
-- right operand)
--
SELECT '0'::cube @ '0'::cube AS bool;
SELECT '0'::cube @> '0'::cube AS bool;
bool
------
t
(1 row)
SELECT '0,0,0'::cube @ '0,0,0'::cube AS bool;
SELECT '0,0,0'::cube @> '0,0,0'::cube AS bool;
bool
------
t
(1 row)
SELECT '0,0,1'::cube @ '0,0'::cube AS bool;
SELECT '0,0,1'::cube @> '0,0'::cube AS bool;
bool
------
t
(1 row)
SELECT '0,0,1'::cube @ '0,0,0'::cube AS bool;
SELECT '0,0,1'::cube @> '0,0,0'::cube AS bool;
bool
------
f
(1 row)
SELECT '0,0,1'::cube @ '1,0,0'::cube AS bool;
SELECT '0,0,1'::cube @> '1,0,0'::cube AS bool;
bool
------
f
(1 row)
SELECT '(1,0,0),(0,0,1)'::cube @ '(1,0,0),(0,0,1)'::cube AS bool;
SELECT '(1,0,0),(0,0,1)'::cube @> '(1,0,0),(0,0,1)'::cube AS bool;
bool
------
t
(1 row)
SELECT '(-1,-1,-1),(1,1,1)'::cube @ '(1,0,0),(0,0,1)'::cube AS bool;
SELECT '(-1,-1,-1),(1,1,1)'::cube @> '(1,0,0),(0,0,1)'::cube AS bool;
bool
------
t
(1 row)
SELECT '(-1,-1,-1,-1),(1,1,1,1)'::cube @ '(1,0,0),(0,0,1)'::cube AS bool;
SELECT '(-1,-1,-1,-1),(1,1,1,1)'::cube @> '(1,0,0),(0,0,1)'::cube AS bool;
bool
------
t
(1 row)
SELECT '(-1),(1)'::cube @ '0'::cube AS bool;
SELECT '(-1),(1)'::cube @> '0'::cube AS bool;
bool
------
t
(1 row)
SELECT '(-1),(1)'::cube @ '1'::cube AS bool;
SELECT '(-1),(1)'::cube @> '1'::cube AS bool;
bool
------
t
(1 row)
SELECT '(-1),(1)'::cube @ '-1'::cube AS bool;
SELECT '(-1),(1)'::cube @> '-1'::cube AS bool;
bool
------
t
(1 row)
SELECT '(-1),(1)'::cube @ '(-1),(1)'::cube AS bool;
SELECT '(-1),(1)'::cube @> '(-1),(1)'::cube AS bool;
bool
------
t
(1 row)
SELECT '(-1,-1),(1,1)'::cube @ '(-1),(1)'::cube AS bool;
SELECT '(-1,-1),(1,1)'::cube @> '(-1),(1)'::cube AS bool;
bool
------
t
(1 row)
SELECT '(-1),(1)'::cube @ '(-2),(1)'::cube AS bool;
SELECT '(-1),(1)'::cube @> '(-2),(1)'::cube AS bool;
bool
------
f
(1 row)
SELECT '(-1,-1),(1,1)'::cube @ '(-2),(1)'::cube AS bool;
SELECT '(-1,-1),(1,1)'::cube @> '(-2),(1)'::cube AS bool;
bool
------
f

View File

@ -627,91 +627,91 @@ SELECT '[(-1,-1,-1),(1,1,1)]'::cube && '[(2,1,1),(2,2,2)]'::cube AS bool;
-- "contained in" (the left operand is the cube entirely enclosed by
-- the right operand):
--
SELECT '0'::cube ~ '0'::cube AS bool;
SELECT '0'::cube <@ '0'::cube AS bool;
bool
------
t
(1 row)
SELECT '0,0,0'::cube ~ '0,0,0'::cube AS bool;
SELECT '0,0,0'::cube <@ '0,0,0'::cube AS bool;
bool
------
t
(1 row)
SELECT '0,0'::cube ~ '0,0,1'::cube AS bool;
SELECT '0,0'::cube <@ '0,0,1'::cube AS bool;
bool
------
t
(1 row)
SELECT '0,0,0'::cube ~ '0,0,1'::cube AS bool;
SELECT '0,0,0'::cube <@ '0,0,1'::cube AS bool;
bool
------
f
(1 row)
SELECT '1,0,0'::cube ~ '0,0,1'::cube AS bool;
SELECT '1,0,0'::cube <@ '0,0,1'::cube AS bool;
bool
------
f
(1 row)
SELECT '(1,0,0),(0,0,1)'::cube ~ '(1,0,0),(0,0,1)'::cube AS bool;
SELECT '(1,0,0),(0,0,1)'::cube <@ '(1,0,0),(0,0,1)'::cube AS bool;
bool
------
t
(1 row)
SELECT '(1,0,0),(0,0,1)'::cube ~ '(-1,-1,-1),(1,1,1)'::cube AS bool;
SELECT '(1,0,0),(0,0,1)'::cube <@ '(-1,-1,-1),(1,1,1)'::cube AS bool;
bool
------
t
(1 row)
SELECT '(1,0,0),(0,0,1)'::cube ~ '(-1,-1,-1,-1),(1,1,1,1)'::cube AS bool;
SELECT '(1,0,0),(0,0,1)'::cube <@ '(-1,-1,-1,-1),(1,1,1,1)'::cube AS bool;
bool
------
t
(1 row)
SELECT '0'::cube ~ '(-1),(1)'::cube AS bool;
SELECT '0'::cube <@ '(-1),(1)'::cube AS bool;
bool
------
t
(1 row)
SELECT '1'::cube ~ '(-1),(1)'::cube AS bool;
SELECT '1'::cube <@ '(-1),(1)'::cube AS bool;
bool
------
t
(1 row)
SELECT '-1'::cube ~ '(-1),(1)'::cube AS bool;
SELECT '-1'::cube <@ '(-1),(1)'::cube AS bool;
bool
------
t
(1 row)
SELECT '(-1),(1)'::cube ~ '(-1),(1)'::cube AS bool;
SELECT '(-1),(1)'::cube <@ '(-1),(1)'::cube AS bool;
bool
------
t
(1 row)
SELECT '(-1),(1)'::cube ~ '(-1,-1),(1,1)'::cube AS bool;
SELECT '(-1),(1)'::cube <@ '(-1,-1),(1,1)'::cube AS bool;
bool
------
t
(1 row)
SELECT '(-2),(1)'::cube ~ '(-1),(1)'::cube AS bool;
SELECT '(-2),(1)'::cube <@ '(-1),(1)'::cube AS bool;
bool
------
f
(1 row)
SELECT '(-2),(1)'::cube ~ '(-1,-1),(1,1)'::cube AS bool;
SELECT '(-2),(1)'::cube <@ '(-1,-1),(1,1)'::cube AS bool;
bool
------
f
@ -720,91 +720,91 @@ SELECT '(-2),(1)'::cube ~ '(-1,-1),(1,1)'::cube AS bool;
-- "contains" (the left operand is the cube that entirely encloses the
-- right operand)
--
SELECT '0'::cube @ '0'::cube AS bool;
SELECT '0'::cube @> '0'::cube AS bool;
bool
------
t
(1 row)
SELECT '0,0,0'::cube @ '0,0,0'::cube AS bool;
SELECT '0,0,0'::cube @> '0,0,0'::cube AS bool;
bool
------
t
(1 row)
SELECT '0,0,1'::cube @ '0,0'::cube AS bool;
SELECT '0,0,1'::cube @> '0,0'::cube AS bool;
bool
------
t
(1 row)
SELECT '0,0,1'::cube @ '0,0,0'::cube AS bool;
SELECT '0,0,1'::cube @> '0,0,0'::cube AS bool;
bool
------
f
(1 row)
SELECT '0,0,1'::cube @ '1,0,0'::cube AS bool;
SELECT '0,0,1'::cube @> '1,0,0'::cube AS bool;
bool
------
f
(1 row)
SELECT '(1,0,0),(0,0,1)'::cube @ '(1,0,0),(0,0,1)'::cube AS bool;
SELECT '(1,0,0),(0,0,1)'::cube @> '(1,0,0),(0,0,1)'::cube AS bool;
bool
------
t
(1 row)
SELECT '(-1,-1,-1),(1,1,1)'::cube @ '(1,0,0),(0,0,1)'::cube AS bool;
SELECT '(-1,-1,-1),(1,1,1)'::cube @> '(1,0,0),(0,0,1)'::cube AS bool;
bool
------
t
(1 row)
SELECT '(-1,-1,-1,-1),(1,1,1,1)'::cube @ '(1,0,0),(0,0,1)'::cube AS bool;
SELECT '(-1,-1,-1,-1),(1,1,1,1)'::cube @> '(1,0,0),(0,0,1)'::cube AS bool;
bool
------
t
(1 row)
SELECT '(-1),(1)'::cube @ '0'::cube AS bool;
SELECT '(-1),(1)'::cube @> '0'::cube AS bool;
bool
------
t
(1 row)
SELECT '(-1),(1)'::cube @ '1'::cube AS bool;
SELECT '(-1),(1)'::cube @> '1'::cube AS bool;
bool
------
t
(1 row)
SELECT '(-1),(1)'::cube @ '-1'::cube AS bool;
SELECT '(-1),(1)'::cube @> '-1'::cube AS bool;
bool
------
t
(1 row)
SELECT '(-1),(1)'::cube @ '(-1),(1)'::cube AS bool;
SELECT '(-1),(1)'::cube @> '(-1),(1)'::cube AS bool;
bool
------
t
(1 row)
SELECT '(-1,-1),(1,1)'::cube @ '(-1),(1)'::cube AS bool;
SELECT '(-1,-1),(1,1)'::cube @> '(-1),(1)'::cube AS bool;
bool
------
t
(1 row)
SELECT '(-1),(1)'::cube @ '(-2),(1)'::cube AS bool;
SELECT '(-1),(1)'::cube @> '(-2),(1)'::cube AS bool;
bool
------
f
(1 row)
SELECT '(-1,-1),(1,1)'::cube @ '(-2),(1)'::cube AS bool;
SELECT '(-1,-1),(1,1)'::cube @> '(-2),(1)'::cube AS bool;
bool
------
f