Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit ba920e1

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

25 files changed

+209
-153
lines changed

doc/src/sgml/func.sgml

+29-9
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

+3-3
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

+3-3
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+
* is contained by: value_array <@ query_array
3737

3838
Synopsis
3939
--------

src/backend/access/gist/gistproc.c

+5-1
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
case RTContainsStrategyNumber:
545+
case RTOldContainsStrategyNumber:
545546
retval = DatumGetBool(DirectFunctionCall2(box_contain,
546547
PointerGetDatum(key),
547548
PointerGetDatum(query)));
548549
break;
549550
case RTContainedByStrategyNumber:
551+
case RTOldContainedByStrategyNumber:
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
case RTSameStrategyNumber:
633635
case RTContainsStrategyNumber:
636+
case RTOldContainsStrategyNumber:
634637
retval = DatumGetBool(DirectFunctionCall2(box_contain,
635638
PointerGetDatum(key),
636639
PointerGetDatum(query)));
637640
break;
638641
case RTContainedByStrategyNumber:
642+
case RTOldContainedByStrategyNumber:
639643
retval = DatumGetBool(DirectFunctionCall2(box_overlap,
640644
PointerGetDatum(key),
641645
PointerGetDatum(query)));

src/include/access/gist.h

+5-3
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/10 00:29:34 tgl Exp $
1313
*
1414
*-------------------------------------------------------------------------
1515
*/
@@ -44,12 +44,14 @@
4444
#define RTOverRightStrategyNumber 4
4545
#define RTRightStrategyNumber 5
4646
#define RTSameStrategyNumber 6
47-
#define RTContainsStrategyNumber 7
48-
#define RTContainedByStrategyNumber 8
47+
#define RTContainsStrategyNumber 7 /* for @> */
48+
#define RTContainedByStrategyNumber 8 /* for <@ */
4949
#define RTOverBelowStrategyNumber 9
5050
#define RTBelowStrategyNumber 10
5151
#define RTAboveStrategyNumber 11
5252
#define RTOverAboveStrategyNumber 12
53+
#define RTOldContainsStrategyNumber 13 /* for old spelling of @> */
54+
#define RTOldContainedByStrategyNumber 14 /* for old spelling of <@ */
5355

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

src/include/catalog/catversion.h

+2-2
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-
#define CATALOG_VERSION_NO 200609051
56+
#define CATALOG_VERSION_NO 200609091
5757

5858
#endif

src/include/catalog/pg_amop.h

+7-1
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 ( 2593 0 9 f 2571 ));
611611
DATA(insert ( 2593 0 10 f 2570 ));
612612
DATA(insert ( 2593 0 11 f 2573 ));
613613
DATA(insert ( 2593 0 12 f 2572 ));
614+
DATA(insert ( 2593 0 13 f 2863 ));
615+
DATA(insert ( 2593 0 14 f 2862 ));
614616

615617
/*
616618
* gist poly_ops (supports polygons)
@@ -628,6 +630,8 @@ DATA(insert ( 2594 0 9 t 2575 ));
628630
DATA(insert ( 2594 0 10 t 2574 ));
629631
DATA(insert ( 2594 0 11 t 2577 ));
630632
DATA(insert ( 2594 0 12 t 2576 ));
633+
DATA(insert ( 2594 0 13 t 2861 ));
634+
DATA(insert ( 2594 0 14 t 2860 ));
631635

632636
/*
633637
* gist circle_ops
@@ -645,6 +649,8 @@ DATA(insert ( 2595 0 9 t 2589 ));
645649
DATA(insert ( 2595 0 10 t 1515 ));
646650
DATA(insert ( 2595 0 11 t 1514 ));
647651
DATA(insert ( 2595 0 12 t 2590 ));
652+
DATA(insert ( 2595 0 13 t 2865 ));
653+
DATA(insert ( 2595 0 14 t 2864 ));
648654

649655
/*
650656
* gin _int4_ops

0 commit comments

Comments
 (0)