mirror of
https://git.postgresql.org/git/postgresql.git
synced 2025-02-05 19:09:58 +08:00
Revert my patch of 2009-04-04 that removed contrib/intarray's definitions of
the <@ and @> operators. These are not in fact equivalent to the built-in anyarray operators of the same names, because they have different behavior for empty arrays, namely they don't think empty arrays are contained in anything. That is mathematically wrong, no doubt, but until we can persuade GIN indexes to implement the mathematical definition we should probably not change this. Another reason for not changing it now is that we can't yet ensure the opclasses will be updated correctly in a dump-and-reload upgrade. Per recent discussions.
This commit is contained in:
parent
32ea236361
commit
156475a589
@ -1,4 +1,4 @@
|
|||||||
/* $PostgreSQL: pgsql/contrib/intarray/_int.sql.in,v 1.30 2009/04/05 00:40:35 tgl Exp $ */
|
/* $PostgreSQL: pgsql/contrib/intarray/_int.sql.in,v 1.31 2009/06/07 20:09:34 tgl Exp $ */
|
||||||
|
|
||||||
-- Adjust this setting to control where the objects get created.
|
-- Adjust this setting to control where the objects get created.
|
||||||
SET search_path = public;
|
SET search_path = public;
|
||||||
@ -152,23 +152,23 @@ CREATE OPERATOR && (
|
|||||||
-- JOIN = neqjoinsel
|
-- JOIN = neqjoinsel
|
||||||
--);
|
--);
|
||||||
|
|
||||||
--CREATE OPERATOR @> (
|
CREATE OPERATOR @> (
|
||||||
-- LEFTARG = _int4,
|
LEFTARG = _int4,
|
||||||
-- RIGHTARG = _int4,
|
RIGHTARG = _int4,
|
||||||
-- PROCEDURE = _int_contains,
|
PROCEDURE = _int_contains,
|
||||||
-- COMMUTATOR = '<@',
|
COMMUTATOR = '<@',
|
||||||
-- RESTRICT = contsel,
|
RESTRICT = contsel,
|
||||||
-- JOIN = contjoinsel
|
JOIN = contjoinsel
|
||||||
--);
|
);
|
||||||
|
|
||||||
--CREATE OPERATOR <@ (
|
CREATE OPERATOR <@ (
|
||||||
-- LEFTARG = _int4,
|
LEFTARG = _int4,
|
||||||
-- RIGHTARG = _int4,
|
RIGHTARG = _int4,
|
||||||
-- PROCEDURE = _int_contained,
|
PROCEDURE = _int_contained,
|
||||||
-- COMMUTATOR = '@>',
|
COMMUTATOR = '@>',
|
||||||
-- RESTRICT = contsel,
|
RESTRICT = contsel,
|
||||||
-- JOIN = contjoinsel
|
JOIN = contjoinsel
|
||||||
--);
|
);
|
||||||
|
|
||||||
-- obsolete:
|
-- obsolete:
|
||||||
CREATE OPERATOR @ (
|
CREATE OPERATOR @ (
|
||||||
@ -365,8 +365,8 @@ CREATE OPERATOR CLASS gist__int_ops
|
|||||||
DEFAULT FOR TYPE _int4 USING gist AS
|
DEFAULT FOR TYPE _int4 USING gist AS
|
||||||
OPERATOR 3 &&,
|
OPERATOR 3 &&,
|
||||||
OPERATOR 6 = (anyarray, anyarray),
|
OPERATOR 6 = (anyarray, anyarray),
|
||||||
OPERATOR 7 @> (anyarray, anyarray),
|
OPERATOR 7 @>,
|
||||||
OPERATOR 8 <@ (anyarray, anyarray),
|
OPERATOR 8 <@,
|
||||||
OPERATOR 13 @,
|
OPERATOR 13 @,
|
||||||
OPERATOR 14 ~,
|
OPERATOR 14 ~,
|
||||||
OPERATOR 20 @@ (_int4, query_int),
|
OPERATOR 20 @@ (_int4, query_int),
|
||||||
@ -442,8 +442,8 @@ FOR TYPE _int4 USING gist
|
|||||||
AS
|
AS
|
||||||
OPERATOR 3 &&,
|
OPERATOR 3 &&,
|
||||||
OPERATOR 6 = (anyarray, anyarray),
|
OPERATOR 6 = (anyarray, anyarray),
|
||||||
OPERATOR 7 @> (anyarray, anyarray),
|
OPERATOR 7 @>,
|
||||||
OPERATOR 8 <@ (anyarray, anyarray),
|
OPERATOR 8 <@,
|
||||||
OPERATOR 13 @,
|
OPERATOR 13 @,
|
||||||
OPERATOR 14 ~,
|
OPERATOR 14 ~,
|
||||||
OPERATOR 20 @@ (_int4, query_int),
|
OPERATOR 20 @@ (_int4, query_int),
|
||||||
@ -473,8 +473,8 @@ FOR TYPE _int4 USING gin
|
|||||||
AS
|
AS
|
||||||
OPERATOR 3 &&,
|
OPERATOR 3 &&,
|
||||||
OPERATOR 6 = (anyarray, anyarray),
|
OPERATOR 6 = (anyarray, anyarray),
|
||||||
OPERATOR 7 @> (anyarray, anyarray),
|
OPERATOR 7 @>,
|
||||||
OPERATOR 8 <@ (anyarray, anyarray),
|
OPERATOR 8 <@,
|
||||||
OPERATOR 13 @,
|
OPERATOR 13 @,
|
||||||
OPERATOR 14 ~,
|
OPERATOR 14 ~,
|
||||||
OPERATOR 20 @@ (_int4, query_int),
|
OPERATOR 20 @@ (_int4, query_int),
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
/* $PostgreSQL: pgsql/contrib/intarray/uninstall__int.sql,v 1.11 2009/04/05 00:40:35 tgl Exp $ */
|
/* $PostgreSQL: pgsql/contrib/intarray/uninstall__int.sql,v 1.12 2009/06/07 20:09:34 tgl Exp $ */
|
||||||
|
|
||||||
-- Adjust this setting to control where the objects get created.
|
-- Adjust this setting to control where the objects get created.
|
||||||
SET search_path = public;
|
SET search_path = public;
|
||||||
@ -91,6 +91,10 @@ DROP FUNCTION icount(_int4);
|
|||||||
|
|
||||||
DROP FUNCTION intset(int4);
|
DROP FUNCTION intset(int4);
|
||||||
|
|
||||||
|
DROP OPERATOR <@ (_int4, _int4);
|
||||||
|
|
||||||
|
DROP OPERATOR @> (_int4, _int4);
|
||||||
|
|
||||||
DROP OPERATOR ~ (_int4, _int4);
|
DROP OPERATOR ~ (_int4, _int4);
|
||||||
|
|
||||||
DROP OPERATOR @ (_int4, _int4);
|
DROP OPERATOR @ (_int4, _int4);
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
<!-- $PostgreSQL: pgsql/doc/src/sgml/intarray.sgml,v 1.7 2009/04/05 00:40:35 tgl Exp $ -->
|
<!-- $PostgreSQL: pgsql/doc/src/sgml/intarray.sgml,v 1.8 2009/06/07 20:09:34 tgl Exp $ -->
|
||||||
|
|
||||||
<sect1 id="intarray">
|
<sect1 id="intarray">
|
||||||
<title>intarray</title>
|
<title>intarray</title>
|
||||||
@ -134,12 +134,12 @@
|
|||||||
<entry>overlap — <literal>true</> if arrays have at least one common element</entry>
|
<entry>overlap — <literal>true</> if arrays have at least one common element</entry>
|
||||||
</row>
|
</row>
|
||||||
<row>
|
<row>
|
||||||
<entry><literal>int[] @ int[]</literal></entry>
|
<entry><literal>int[] @> int[]</literal></entry>
|
||||||
<entry><type>boolean</type></entry>
|
<entry><type>boolean</type></entry>
|
||||||
<entry>contains — <literal>true</> if left array contains right array</entry>
|
<entry>contains — <literal>true</> if left array contains right array</entry>
|
||||||
</row>
|
</row>
|
||||||
<row>
|
<row>
|
||||||
<entry><literal>int[] ~ int[]</literal></entry>
|
<entry><literal>int[] <@ int[]</literal></entry>
|
||||||
<entry><type>boolean</type></entry>
|
<entry><type>boolean</type></entry>
|
||||||
<entry>contained — <literal>true</> if left array is contained in right array</entry>
|
<entry>contained — <literal>true</> if left array is contained in right array</entry>
|
||||||
</row>
|
</row>
|
||||||
@ -203,13 +203,22 @@
|
|||||||
</table>
|
</table>
|
||||||
|
|
||||||
<para>
|
<para>
|
||||||
The containment operators <literal>@</> and <literal>~</> are functionally
|
(Before PostgreSQL 8.2, the containment operators <literal>@></> and
|
||||||
equivalent to <productname>PostgreSQL</>'s built-in operators
|
<literal><@</> were respectively called <literal>@</> and <literal>~</>.
|
||||||
<literal>@></> and <literal><@</>, respectively, except that
|
These names are still available, but are deprecated and will eventually be
|
||||||
<literal>@</> and <literal>~</> work only on integer arrays. These
|
retired. Notice that the old names are reversed from the convention
|
||||||
operator names are deprecated and will eventually be retired. (Notice that
|
formerly followed by the core geometric datatypes!)
|
||||||
these names are reversed from the convention formerly followed by the core
|
</para>
|
||||||
geometric datatypes!)
|
|
||||||
|
<para>
|
||||||
|
The containment operators <literal>@></> and <literal><@</> are
|
||||||
|
approximately equivalent to <productname>PostgreSQL</>'s built-in operators
|
||||||
|
of the same names, except that they work only on integer arrays while the
|
||||||
|
built-in operators work for any array type. An important difference is
|
||||||
|
that <filename>intarray</>'s operators do not consider an empty array to be
|
||||||
|
contained in anything else. This is consistent with the behavior of
|
||||||
|
GIN-indexed queries, but not with the usual mathematical definition of
|
||||||
|
containment.
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
<para>
|
<para>
|
||||||
@ -230,10 +239,8 @@
|
|||||||
|
|
||||||
<para>
|
<para>
|
||||||
<filename>intarray</> provides index support for the
|
<filename>intarray</> provides index support for the
|
||||||
<literal>&&</>, <literal>@</>, <literal>~</>,
|
<literal>&&</>, <literal>@></>, <literal><@</>,
|
||||||
and <literal>@@</> operators, as well as regular array equality
|
and <literal>@@</> operators, as well as regular array equality.
|
||||||
and the built-in <literal>@></> and <literal><@</> operators
|
|
||||||
(when used on integer arrays).
|
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
<para>
|
<para>
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
<!-- $PostgreSQL: pgsql/doc/src/sgml/release-8.4.sgml,v 1.7 2009/05/27 22:12:53 tgl Exp $ -->
|
<!-- $PostgreSQL: pgsql/doc/src/sgml/release-8.4.sgml,v 1.8 2009/06/07 20:09:34 tgl Exp $ -->
|
||||||
<!-- See header comment in release.sgml about typical markup -->
|
<!-- See header comment in release.sgml about typical markup -->
|
||||||
|
|
||||||
<sect1 id="release-8-4">
|
<sect1 id="release-8-4">
|
||||||
@ -3321,20 +3321,6 @@
|
|||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
|
|
||||||
<listitem>
|
|
||||||
<para>
|
|
||||||
Remove <filename>contrib/intarray</>'s definitions of the
|
|
||||||
<literal><@</> and <literal>@></> operators (Tom)
|
|
||||||
</para>
|
|
||||||
|
|
||||||
<para>
|
|
||||||
This avoids confusion with the equivalent built-in operators.
|
|
||||||
If needed, the <filename>contrib/intarray</> implementations
|
|
||||||
are still available under their historical names <literal>@</>
|
|
||||||
and <literal>~</>.
|
|
||||||
</para>
|
|
||||||
</listitem>
|
|
||||||
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
Make <filename>contrib/pg_standby</> recover all available WAL before
|
Make <filename>contrib/pg_standby</> recover all available WAL before
|
||||||
|
Loading…
Reference in New Issue
Block a user