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

Commitba920e1

Browse files
committed
Rename contains/contained-by operators to @> and <@, per discussion that
agreed these symbols are less easily confused. I made new pg_operatorentries (with new OIDs) for the old names, so as to provide backwardcompatibility while making it pretty easy to remove the old names insome future release cycle. This commit only touches the core datatypes,contrib will be fixed separately.
1 parent9cea5a8 commitba920e1

25 files changed

+209
-153
lines changed

‎doc/src/sgml/func.sgml

Lines changed: 29 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!-- $PostgreSQL: pgsql/doc/src/sgml/func.sgml,v 1.334 2006/09/05 21:08:33 tgl Exp $ -->
1+
<!-- $PostgreSQL: pgsql/doc/src/sgml/func.sgml,v 1.335 2006/09/10 00:29:33 tgl Exp $ -->
22

33
<chapter id="functions">
44
<title>Functions and Operators</title>
@@ -6498,14 +6498,14 @@ SELECT pg_sleep(1.5);
64986498
<entry><literal>lseg '((-1,0),(1,0))' ?|| lseg '((-1,2),(1,2))'</literal></entry>
64996499
</row>
65006500
<row>
6501-
<entry> <literal>~</literal> </entry>
6501+
<entry> <literal>@&gt;</literal> </entry>
65026502
<entry>Contains?</entry>
6503-
<entry><literal>circle '((0,0),2)'~ point '(1,1)'</literal></entry>
6503+
<entry><literal>circle '((0,0),2)'@&gt; point '(1,1)'</literal></entry>
65046504
</row>
65056505
<row>
6506-
<entry> <literal>@</literal> </entry>
6506+
<entry> <literal>&lt;@</literal> </entry>
65076507
<entry>Contained in or on?</entry>
6508-
<entry><literal>point '(1,1)' @ circle '((0,0),2)'</literal></entry>
6508+
<entry><literal>point '(1,1)'&lt;@ circle '((0,0),2)'</literal></entry>
65096509
</row>
65106510
<row>
65116511
<entry> <literal>~=</literal> </entry>
@@ -6516,6 +6516,15 @@ SELECT pg_sleep(1.5);
65166516
</tgroup>
65176517
</table>
65186518

6519+
<note>
6520+
<para>
6521+
Before <productname>PostgreSQL</productname> 8.2, the containment
6522+
operators <literal>@&gt;</> and <literal>&lt;@</> were respectively
6523+
called <literal>~</> and <literal>@</>. These names are still
6524+
available, but are deprecated and will eventually be retired.
6525+
</para>
6526+
</note>
6527+
65196528
<indexterm>
65206529
<primary>area</primary>
65216530
</indexterm>
@@ -7051,10 +7060,7 @@ SELECT pg_sleep(1.5);
70517060
available for use with the <type>macaddr</type> type. The function
70527061
<literal><function>trunc</function>(<type>macaddr</type>)</literal> returns a MAC
70537062
address with the last 3 bytes set to zero. This can be used to
7054-
associate the remaining prefix with a manufacturer. The directory
7055-
<filename>contrib/mac</filename> in the source distribution
7056-
contains some utilities to create and maintain such an association
7057-
table.
7063+
associate the remaining prefix with a manufacturer.
70587064
</para>
70597065

70607066
<table id="macaddr-functions-table">
@@ -7613,6 +7619,20 @@ SELECT NULLIF(value, '(none)') ...
76137619
<entry><literal>t</literal></entry>
76147620
</row>
76157621

7622+
<row>
7623+
<entry> <literal>@&gt;</literal> </entry>
7624+
<entry>contains</entry>
7625+
<entry><literal>ARRAY[1,4,3] @&gt; ARRAY[3,1]</literal></entry>
7626+
<entry><literal>t</literal></entry>
7627+
</row>
7628+
7629+
<row>
7630+
<entry> <literal>&lt;@</literal> </entry>
7631+
<entry>is contained by</entry>
7632+
<entry><literal>ARRAY[2,7] &lt;@ ARRAY[1,7,4,2,6]</literal></entry>
7633+
<entry><literal>t</literal></entry>
7634+
</row>
7635+
76167636
<row>
76177637
<entry> <literal>||</literal> </entry>
76187638
<entry>array-to-array concatenation</entry>

‎doc/src/sgml/indices.sgml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!-- $PostgreSQL: pgsql/doc/src/sgml/indices.sgml,v 1.59 2006/09/04 19:58:02 momjian Exp $ -->
1+
<!-- $PostgreSQL: pgsql/doc/src/sgml/indices.sgml,v 1.60 2006/09/10 00:29:34 tgl Exp $ -->
22

33
<chapter id="indexes">
44
<title id="indexes-title">Indexes</title>
@@ -225,8 +225,8 @@ CREATE INDEX <replaceable>name</replaceable> ON <replaceable>table</replaceable>
225225
<member><literal>&amp;&lt;|</literal></member>
226226
<member><literal>|&amp;&gt;</literal></member>
227227
<member><literal>|&gt;&gt;</literal></member>
228-
<member><literal>~</literal></member>
229-
<member><literal>@</literal></member>
228+
<member><literal>@&gt;</literal></member>
229+
<member><literal>&lt;@</literal></member>
230230
<member><literal>~=</literal></member>
231231
<member><literal>&amp;&amp;</literal></member>
232232
</simplelist>

‎src/backend/access/gin/README

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,9 @@ Gin comes with built-in support for one-dimensional arrays (eg. integer[],
3131
text[]), but no support for NULL elements. The following operations are
3232
available:
3333

34-
* contains: value_array @ query_array
35-
*overlap: value_array && query_array
36-
* contained: value_array~ query_array
34+
* contains: value_array @> query_array
35+
*overlaps: value_array && query_array
36+
*iscontained by: value_array<@ query_array
3737

3838
Synopsis
3939
--------

‎src/backend/access/gist/gistproc.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
* Portions Copyright (c) 1994, Regents of the University of California
1111
*
1212
* IDENTIFICATION
13-
*$PostgreSQL: pgsql/src/backend/access/gist/gistproc.c,v 1.7 2006/07/14 14:52:16 momjian Exp $
13+
*$PostgreSQL: pgsql/src/backend/access/gist/gistproc.c,v 1.8 2006/09/10 00:29:34 tgl Exp $
1414
*
1515
*-------------------------------------------------------------------------
1616
*/
@@ -542,11 +542,13 @@ gist_box_leaf_consistent(BOX *key, BOX *query, StrategyNumber strategy)
542542
PointerGetDatum(query)));
543543
break;
544544
caseRTContainsStrategyNumber:
545+
caseRTOldContainsStrategyNumber:
545546
retval=DatumGetBool(DirectFunctionCall2(box_contain,
546547
PointerGetDatum(key),
547548
PointerGetDatum(query)));
548549
break;
549550
caseRTContainedByStrategyNumber:
551+
caseRTOldContainedByStrategyNumber:
550552
retval=DatumGetBool(DirectFunctionCall2(box_contained,
551553
PointerGetDatum(key),
552554
PointerGetDatum(query)));
@@ -631,11 +633,13 @@ rtree_internal_consistent(BOX *key, BOX *query, StrategyNumber strategy)
631633
break;
632634
caseRTSameStrategyNumber:
633635
caseRTContainsStrategyNumber:
636+
caseRTOldContainsStrategyNumber:
634637
retval=DatumGetBool(DirectFunctionCall2(box_contain,
635638
PointerGetDatum(key),
636639
PointerGetDatum(query)));
637640
break;
638641
caseRTContainedByStrategyNumber:
642+
caseRTOldContainedByStrategyNumber:
639643
retval=DatumGetBool(DirectFunctionCall2(box_overlap,
640644
PointerGetDatum(key),
641645
PointerGetDatum(query)));

‎src/include/access/gist.h

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
* Portions Copyright (c) 1996-2006, PostgreSQL Global Development Group
1010
* Portions Copyright (c) 1994, Regents of the University of California
1111
*
12-
* $PostgreSQL: pgsql/src/include/access/gist.h,v 1.54 2006/06/28 12:00:14 teodor Exp $
12+
* $PostgreSQL: pgsql/src/include/access/gist.h,v 1.55 2006/09/1000:29:34 tgl Exp $
1313
*
1414
*-------------------------------------------------------------------------
1515
*/
@@ -44,12 +44,14 @@
4444
#defineRTOverRightStrategyNumber4
4545
#defineRTRightStrategyNumber5
4646
#defineRTSameStrategyNumber6
47-
#defineRTContainsStrategyNumber7
48-
#defineRTContainedByStrategyNumber8
47+
#defineRTContainsStrategyNumber7/* for @> */
48+
#defineRTContainedByStrategyNumber8/* for <@ */
4949
#defineRTOverBelowStrategyNumber9
5050
#defineRTBelowStrategyNumber10
5151
#defineRTAboveStrategyNumber11
5252
#defineRTOverAboveStrategyNumber12
53+
#defineRTOldContainsStrategyNumber13/* for old spelling of @> */
54+
#defineRTOldContainedByStrategyNumber14/* for old spelling of <@ */
5355

5456
/*
5557
* Page opaque data in a GiST index page.

‎src/include/catalog/catversion.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
* Portions Copyright (c) 1996-2006, PostgreSQL Global Development Group
3838
* Portions Copyright (c) 1994, Regents of the University of California
3939
*
40-
* $PostgreSQL: pgsql/src/include/catalog/catversion.h,v 1.354 2006/09/05 21:08:36 tgl Exp $
40+
* $PostgreSQL: pgsql/src/include/catalog/catversion.h,v 1.355 2006/09/10 00:29:34 tgl Exp $
4141
*
4242
*-------------------------------------------------------------------------
4343
*/
@@ -53,6 +53,6 @@
5353
*/
5454

5555
/*yyyymmddN */
56-
#defineCATALOG_VERSION_NO200609051
56+
#defineCATALOG_VERSION_NO200609091
5757

5858
#endif

‎src/include/catalog/pg_amop.h

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
* Portions Copyright (c) 1996-2006, PostgreSQL Global Development Group
2424
* Portions Copyright (c) 1994, Regents of the University of California
2525
*
26-
* $PostgreSQL: pgsql/src/include/catalog/pg_amop.h,v 1.73 2006/07/21 20:51:33 tgl Exp $
26+
* $PostgreSQL: pgsql/src/include/catalog/pg_amop.h,v 1.74 2006/09/10 00:29:34 tgl Exp $
2727
*
2828
* NOTES
2929
* the genbki.sh script reads this file and generates .bki
@@ -611,6 +611,8 @@ DATA(insert (25930 9 f2571 ));
611611
DATA(insert (2593010f2570 ));
612612
DATA(insert (2593011f2573 ));
613613
DATA(insert (2593012f2572 ));
614+
DATA(insert (2593013f2863 ));
615+
DATA(insert (2593014f2862 ));
614616

615617
/*
616618
*gist poly_ops (supports polygons)
@@ -628,6 +630,8 @@ DATA(insert (25940 9 t2575 ));
628630
DATA(insert (2594010t2574 ));
629631
DATA(insert (2594011t2577 ));
630632
DATA(insert (2594012t2576 ));
633+
DATA(insert (2594013t2861 ));
634+
DATA(insert (2594014t2860 ));
631635

632636
/*
633637
*gist circle_ops
@@ -645,6 +649,8 @@ DATA(insert (25950 9 t2589 ));
645649
DATA(insert (2595010t1515 ));
646650
DATA(insert (2595011t1514 ));
647651
DATA(insert (2595012t2590 ));
652+
DATA(insert (2595013t2865 ));
653+
DATA(insert (2595014t2864 ));
648654

649655
/*
650656
* gin _int4_ops

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp