Skip site navigation (1) Skip section navigation (2)

Patch of intarray module in v7.4.1

From: "Korea PostgreSQL Users' Group" <pgsql-kr(at)postgresql(dot)or(dot)kr>
To: pgsql-patches(at)postgresql(dot)org
Subject: Patch of intarray module in v7.4.1
Date: 2004-01-08 06:25:53
Message-ID: 20040108062553.GA12342@postgresql.or.kr (view raw or flat)
Thread:
Lists: pgsql-patches
In 7.4.1, intarray module have a problme about equal operator (=).

  select * from table where intarray_column = '{}';

above query make error.
because when not equal operator (<>) is made,
this make incorrect equal operator by implicate.

so, I patched.
Patch content is here.

===== BEGIN of FILE =====
--- _int.sql.in.orig	Thu Jun 12 03:44:15 2003
+++ _int.sql.in	Wed Jan  7 13:14:37 2004
@@ -140,15 +140,15 @@
 --	SORT2 = '<'
 --);
 
-CREATE OPERATOR <> (
-	LEFTARG = _int4,
-	RIGHTARG = _int4,
-	PROCEDURE = _int_different,
-	COMMUTATOR = '<>',
-	NEGATOR = '=',
-	RESTRICT = neqsel,
-	JOIN = neqjoinsel
-);
+--CREATE OPERATOR <> (
+--	LEFTARG = _int4,
+--	RIGHTARG = _int4,
+--	PROCEDURE = _int_different,
+--	COMMUTATOR = '<>',
+--	NEGATOR = '=',
+--	RESTRICT = neqsel,
+--	JOIN = neqjoinsel
+--);
 
 CREATE OPERATOR @ (
 	LEFTARG = _int4,
@@ -343,7 +343,7 @@
 CREATE OPERATOR CLASS gist__int_ops
 DEFAULT FOR TYPE _int4 USING gist AS
 	OPERATOR	3	&&,
-	OPERATOR	6	=	RECHECK,
+	OPERATOR	6	= (anyarray, anyarray)	RECHECK,
 	OPERATOR	7	@,
 	OPERATOR	8	~,
 	OPERATOR	20	@@ (_int4, query_int),
@@ -418,7 +418,7 @@
 FOR TYPE _int4 USING gist
 AS
 	OPERATOR	3	&&	RECHECK,
-	OPERATOR	6	=	RECHECK,
+	OPERATOR	6	= (anyarray, anyarray)	RECHECK,
 	OPERATOR	7	@	RECHECK,
 	OPERATOR	8	~	RECHECK,
 	OPERATOR	20	@@ (_int4, query_int)	RECHECK,
===== End of FILE =====

Responses

pgsql-patches by date

Next:From: Zach IrmenDate: 2004-01-08 06:26:47
Subject: Re: psql \i handling ~ in specified file name
Previous:From: Manfred SpraulDate: 2004-01-08 06:17:06
Subject: Re: SIGPIPE handling

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group