Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit684ad6a

Browse files
committed
Rename contrib contains/contained-by operators to @> and <@, per discussion.
1 parentba920e1 commit684ad6a

36 files changed

+1290
-1111
lines changed

‎contrib/cube/README.cube

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -201,14 +201,20 @@ a && bOverlaps
201201

202202
The cubements a and b overlap.
203203

204-
a @ bContains
204+
a @> bContains
205205

206206
The cubement a contains the cubement b.
207207

208-
a~ bContained in
208+
a<@ bContained in
209209

210210
The cubement a is contained in b.
211211

212+
(Before PostgreSQL 8.2, the containment operators @> and <@ were
213+
respectively called @ and ~. These names are still available, but are
214+
deprecated and will eventually be retired. Notice that the old names
215+
are reversed from the convention formerly followed by the core geometric
216+
datatypes!)
217+
212218
Although the mnemonics of the following operators is questionable, I
213219
preserved them to maintain visual consistency with other geometric
214220
data types defined in Postgres.

‎contrib/cube/cube.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/******************************************************************************
2-
$PostgreSQL: pgsql/contrib/cube/cube.c,v 1.28 2006/07/27 21:55:09 tgl Exp $
2+
$PostgreSQL: pgsql/contrib/cube/cube.c,v 1.29 2006/09/10 17:36:50 tgl Exp $
33
44
This file contains routines that can be bound to a Postgres backend and
55
called by the backend in the process of processing queries. The calling
@@ -689,9 +689,11 @@ g_cube_leaf_consistent(NDBOX * key,
689689
retval= (bool) (cube_cmp_v0(key,query)==0);
690690
break;
691691
caseRTContainsStrategyNumber:
692+
caseRTOldContainsStrategyNumber:
692693
retval= (bool)cube_contains_v0(key,query);
693694
break;
694695
caseRTContainedByStrategyNumber:
696+
caseRTOldContainedByStrategyNumber:
695697
retval= (bool)cube_contains_v0(query,key);
696698
break;
697699
default:
@@ -717,9 +719,11 @@ g_cube_internal_consistent(NDBOX * key,
717719
break;
718720
caseRTSameStrategyNumber:
719721
caseRTContainsStrategyNumber:
722+
caseRTOldContainsStrategyNumber:
720723
retval= (bool)cube_contains_v0(key,query);
721724
break;
722725
caseRTContainedByStrategyNumber:
726+
caseRTOldContainedByStrategyNumber:
723727
retval= (bool)cube_overlap_v0(key,query);
724728
break;
725729
default:

‎contrib/cube/cube.sql.in

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -243,6 +243,19 @@ CREATE OPERATOR <> (
243243
RESTRICT = neqsel, JOIN = neqjoinsel
244244
);
245245

246+
CREATE OPERATOR @> (
247+
LEFTARG = cube, RIGHTARG = cube, PROCEDURE = cube_contains,
248+
COMMUTATOR = '<@',
249+
RESTRICT = contsel, JOIN = contjoinsel
250+
);
251+
252+
CREATE OPERATOR <@ (
253+
LEFTARG = cube, RIGHTARG = cube, PROCEDURE = cube_contained,
254+
COMMUTATOR = '@>',
255+
RESTRICT = contsel, JOIN = contjoinsel
256+
);
257+
258+
-- these are obsolete/deprecated:
246259
CREATE OPERATOR @ (
247260
LEFTARG = cube, RIGHTARG = cube, PROCEDURE = cube_contains,
248261
COMMUTATOR = '~',
@@ -308,8 +321,10 @@ CREATE OPERATOR CLASS gist_cube_ops
308321
DEFAULT FOR TYPE cube USING gist AS
309322
OPERATOR3&& ,
310323
OPERATOR6= ,
311-
OPERATOR7@ ,
312-
OPERATOR8~ ,
324+
OPERATOR7@> ,
325+
OPERATOR8<@ ,
326+
OPERATOR13@ ,
327+
OPERATOR14~ ,
313328
FUNCTION1g_cube_consistent (internal, cube, int4),
314329
FUNCTION2g_cube_union (internal, internal),
315330
FUNCTION3g_cube_compress (internal),

‎contrib/cube/expected/cube.out

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -627,91 +627,91 @@ SELECT '[(-1,-1,-1),(1,1,1)]'::cube && '[(2,1,1),(2,2,2)]'::cube AS bool;
627627
-- "contained in" (the left operand is the cube entirely enclosed by
628628
-- the right operand):
629629
--
630-
SELECT '0'::cube~ '0'::cube AS bool;
630+
SELECT '0'::cube<@ '0'::cube AS bool;
631631
bool
632632
------
633633
t
634634
(1 row)
635635

636-
SELECT '0,0,0'::cube~ '0,0,0'::cube AS bool;
636+
SELECT '0,0,0'::cube<@ '0,0,0'::cube AS bool;
637637
bool
638638
------
639639
t
640640
(1 row)
641641

642-
SELECT '0,0'::cube~ '0,0,1'::cube AS bool;
642+
SELECT '0,0'::cube<@ '0,0,1'::cube AS bool;
643643
bool
644644
------
645645
t
646646
(1 row)
647647

648-
SELECT '0,0,0'::cube~ '0,0,1'::cube AS bool;
648+
SELECT '0,0,0'::cube<@ '0,0,1'::cube AS bool;
649649
bool
650650
------
651651
f
652652
(1 row)
653653

654-
SELECT '1,0,0'::cube~ '0,0,1'::cube AS bool;
654+
SELECT '1,0,0'::cube<@ '0,0,1'::cube AS bool;
655655
bool
656656
------
657657
f
658658
(1 row)
659659

660-
SELECT '(1,0,0),(0,0,1)'::cube~ '(1,0,0),(0,0,1)'::cube AS bool;
660+
SELECT '(1,0,0),(0,0,1)'::cube<@ '(1,0,0),(0,0,1)'::cube AS bool;
661661
bool
662662
------
663663
t
664664
(1 row)
665665

666-
SELECT '(1,0,0),(0,0,1)'::cube~ '(-1,-1,-1),(1,1,1)'::cube AS bool;
666+
SELECT '(1,0,0),(0,0,1)'::cube<@ '(-1,-1,-1),(1,1,1)'::cube AS bool;
667667
bool
668668
------
669669
t
670670
(1 row)
671671

672-
SELECT '(1,0,0),(0,0,1)'::cube~ '(-1,-1,-1,-1),(1,1,1,1)'::cube AS bool;
672+
SELECT '(1,0,0),(0,0,1)'::cube<@ '(-1,-1,-1,-1),(1,1,1,1)'::cube AS bool;
673673
bool
674674
------
675675
t
676676
(1 row)
677677

678-
SELECT '0'::cube~ '(-1),(1)'::cube AS bool;
678+
SELECT '0'::cube<@ '(-1),(1)'::cube AS bool;
679679
bool
680680
------
681681
t
682682
(1 row)
683683

684-
SELECT '1'::cube~ '(-1),(1)'::cube AS bool;
684+
SELECT '1'::cube<@ '(-1),(1)'::cube AS bool;
685685
bool
686686
------
687687
t
688688
(1 row)
689689

690-
SELECT '-1'::cube~ '(-1),(1)'::cube AS bool;
690+
SELECT '-1'::cube<@ '(-1),(1)'::cube AS bool;
691691
bool
692692
------
693693
t
694694
(1 row)
695695

696-
SELECT '(-1),(1)'::cube~ '(-1),(1)'::cube AS bool;
696+
SELECT '(-1),(1)'::cube<@ '(-1),(1)'::cube AS bool;
697697
bool
698698
------
699699
t
700700
(1 row)
701701

702-
SELECT '(-1),(1)'::cube~ '(-1,-1),(1,1)'::cube AS bool;
702+
SELECT '(-1),(1)'::cube<@ '(-1,-1),(1,1)'::cube AS bool;
703703
bool
704704
------
705705
t
706706
(1 row)
707707

708-
SELECT '(-2),(1)'::cube~ '(-1),(1)'::cube AS bool;
708+
SELECT '(-2),(1)'::cube<@ '(-1),(1)'::cube AS bool;
709709
bool
710710
------
711711
f
712712
(1 row)
713713

714-
SELECT '(-2),(1)'::cube~ '(-1,-1),(1,1)'::cube AS bool;
714+
SELECT '(-2),(1)'::cube<@ '(-1,-1),(1,1)'::cube AS bool;
715715
bool
716716
------
717717
f
@@ -720,91 +720,91 @@ SELECT '(-2),(1)'::cube ~ '(-1,-1),(1,1)'::cube AS bool;
720720
-- "contains" (the left operand is the cube that entirely encloses the
721721
-- right operand)
722722
--
723-
SELECT '0'::cube @ '0'::cube AS bool;
723+
SELECT '0'::cube @> '0'::cube AS bool;
724724
bool
725725
------
726726
t
727727
(1 row)
728728

729-
SELECT '0,0,0'::cube @ '0,0,0'::cube AS bool;
729+
SELECT '0,0,0'::cube @> '0,0,0'::cube AS bool;
730730
bool
731731
------
732732
t
733733
(1 row)
734734

735-
SELECT '0,0,1'::cube @ '0,0'::cube AS bool;
735+
SELECT '0,0,1'::cube @> '0,0'::cube AS bool;
736736
bool
737737
------
738738
t
739739
(1 row)
740740

741-
SELECT '0,0,1'::cube @ '0,0,0'::cube AS bool;
741+
SELECT '0,0,1'::cube @> '0,0,0'::cube AS bool;
742742
bool
743743
------
744744
f
745745
(1 row)
746746

747-
SELECT '0,0,1'::cube @ '1,0,0'::cube AS bool;
747+
SELECT '0,0,1'::cube @> '1,0,0'::cube AS bool;
748748
bool
749749
------
750750
f
751751
(1 row)
752752

753-
SELECT '(1,0,0),(0,0,1)'::cube @ '(1,0,0),(0,0,1)'::cube AS bool;
753+
SELECT '(1,0,0),(0,0,1)'::cube @> '(1,0,0),(0,0,1)'::cube AS bool;
754754
bool
755755
------
756756
t
757757
(1 row)
758758

759-
SELECT '(-1,-1,-1),(1,1,1)'::cube @ '(1,0,0),(0,0,1)'::cube AS bool;
759+
SELECT '(-1,-1,-1),(1,1,1)'::cube @> '(1,0,0),(0,0,1)'::cube AS bool;
760760
bool
761761
------
762762
t
763763
(1 row)
764764

765-
SELECT '(-1,-1,-1,-1),(1,1,1,1)'::cube @ '(1,0,0),(0,0,1)'::cube AS bool;
765+
SELECT '(-1,-1,-1,-1),(1,1,1,1)'::cube @> '(1,0,0),(0,0,1)'::cube AS bool;
766766
bool
767767
------
768768
t
769769
(1 row)
770770

771-
SELECT '(-1),(1)'::cube @ '0'::cube AS bool;
771+
SELECT '(-1),(1)'::cube @> '0'::cube AS bool;
772772
bool
773773
------
774774
t
775775
(1 row)
776776

777-
SELECT '(-1),(1)'::cube @ '1'::cube AS bool;
777+
SELECT '(-1),(1)'::cube @> '1'::cube AS bool;
778778
bool
779779
------
780780
t
781781
(1 row)
782782

783-
SELECT '(-1),(1)'::cube @ '-1'::cube AS bool;
783+
SELECT '(-1),(1)'::cube @> '-1'::cube AS bool;
784784
bool
785785
------
786786
t
787787
(1 row)
788788

789-
SELECT '(-1),(1)'::cube @ '(-1),(1)'::cube AS bool;
789+
SELECT '(-1),(1)'::cube @> '(-1),(1)'::cube AS bool;
790790
bool
791791
------
792792
t
793793
(1 row)
794794

795-
SELECT '(-1,-1),(1,1)'::cube @ '(-1),(1)'::cube AS bool;
795+
SELECT '(-1,-1),(1,1)'::cube @> '(-1),(1)'::cube AS bool;
796796
bool
797797
------
798798
t
799799
(1 row)
800800

801-
SELECT '(-1),(1)'::cube @ '(-2),(1)'::cube AS bool;
801+
SELECT '(-1),(1)'::cube @> '(-2),(1)'::cube AS bool;
802802
bool
803803
------
804804
f
805805
(1 row)
806806

807-
SELECT '(-1,-1),(1,1)'::cube @ '(-2),(1)'::cube AS bool;
807+
SELECT '(-1,-1),(1,1)'::cube @> '(-2),(1)'::cube AS bool;
808808
bool
809809
------
810810
f

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp