Push index operator lossiness determination down to GIST/GIN opclass
authorTom Lane <tgl@sss.pgh.pa.us>
Mon, 14 Apr 2008 17:05:34 +0000 (17:05 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Mon, 14 Apr 2008 17:05:34 +0000 (17:05 +0000)
"consistent" functions, and remove pg_amop.opreqcheck, as per recent
discussion.  The main immediate benefit of this is that we no longer need
8.3's ugly hack of requiring @@@ rather than @@ to test weight-using tsquery
searches on GIN indexes.  In future it should be possible to optimize some
other queries better than is done now, by detecting at runtime whether the
index match is exact or not.

Tom Lane, after an idea of Heikki's, and with some help from Teodor.

68 files changed:
contrib/btree_gist/btree_bit.c
contrib/btree_gist/btree_bytea.c
contrib/btree_gist/btree_cash.c
contrib/btree_gist/btree_date.c
contrib/btree_gist/btree_float4.c
contrib/btree_gist/btree_float8.c
contrib/btree_gist/btree_gist.sql.in
contrib/btree_gist/btree_inet.c
contrib/btree_gist/btree_int2.c
contrib/btree_gist/btree_int4.c
contrib/btree_gist/btree_int8.c
contrib/btree_gist/btree_interval.c
contrib/btree_gist/btree_macaddr.c
contrib/btree_gist/btree_numeric.c
contrib/btree_gist/btree_oid.c
contrib/btree_gist/btree_text.c
contrib/btree_gist/btree_time.c
contrib/btree_gist/btree_ts.c
contrib/btree_gist/uninstall_btree_gist.sql
contrib/cube/cube.c
contrib/cube/cube.sql.in
contrib/cube/uninstall_cube.sql
contrib/hstore/hstore.sql.in
contrib/hstore/hstore_gin.c
contrib/hstore/hstore_gist.c
contrib/hstore/uninstall_hstore.sql
contrib/intarray/_int.sql.in
contrib/intarray/_int_gin.c
contrib/intarray/_int_gist.c
contrib/intarray/_intbig_gist.c
contrib/intarray/uninstall__int.sql
contrib/ltree/_ltree_gist.c
contrib/ltree/ltree.sql.in
contrib/ltree/ltree_gist.c
contrib/ltree/uninstall_ltree.sql
contrib/pg_trgm/pg_trgm.sql.in
contrib/pg_trgm/trgm_gin.c
contrib/pg_trgm/trgm_gist.c
contrib/pg_trgm/uninstall_pg_trgm.sql
contrib/seg/seg.c
contrib/seg/seg.sql.in
contrib/seg/uninstall_seg.sql
contrib/tsearch2/tsearch2.sql.in
doc/src/sgml/catalogs.sgml
doc/src/sgml/func.sgml
doc/src/sgml/gin.sgml
doc/src/sgml/gist.sgml
doc/src/sgml/indexam.sgml
doc/src/sgml/ref/alter_opfamily.sgml
doc/src/sgml/ref/create_opclass.sgml
doc/src/sgml/textsearch.sgml
doc/src/sgml/xindex.sgml
src/backend/access/gin/ginarrayproc.c
src/backend/access/gin/ginget.c
src/backend/access/gist/gistget.c
src/backend/access/gist/gistproc.c
src/backend/commands/opclasscmds.c
src/backend/nodes/copyfuncs.c
src/backend/nodes/equalfuncs.c
src/backend/parser/gram.y
src/backend/utils/adt/tsginidx.c
src/backend/utils/adt/tsgistidx.c
src/backend/utils/adt/tsquery_gist.c
src/bin/pg_dump/pg_dump.c
src/include/catalog/catversion.h
src/include/catalog/pg_amop.h
src/include/catalog/pg_proc.h
src/include/nodes/parsenodes.h

index 534c9af8131126f0765a1b0f728ed6b78b799ec1..d86034fd6ffc4fced5f535bd0da66fc1a540d4ee 100644 (file)
@@ -126,12 +126,17 @@ Datum
 gbt_bit_consistent(PG_FUNCTION_ARGS)
 {
        GISTENTRY  *entry = (GISTENTRY *) PG_GETARG_POINTER(0);
-       GBT_VARKEY *key = (GBT_VARKEY *) DatumGetPointer(entry->key);
        void       *query = (void *) DatumGetByteaP(PG_GETARG_DATUM(1));
        StrategyNumber strategy = (StrategyNumber) PG_GETARG_UINT16(2);
+       /* Oid          subtype = PG_GETARG_OID(3); */
+       bool       *recheck = (bool *) PG_GETARG_POINTER(4);
        bool            retval = FALSE;
+       GBT_VARKEY *key = (GBT_VARKEY *) DatumGetPointer(entry->key);
        GBT_VARKEY_R r = gbt_var_key_readable(key);
 
+       /* All cases served by this function are exact */
+       *recheck = false;
+
        if (GIST_LEAF(entry))
                retval = gbt_var_consistent(&r, query, &strategy, TRUE, &tinfo);
        else
index d5345872d6e22110bf74aeb592d3d94b2e77c61e..02229653f484659a7afbfccdae54aeeede3d6b4e 100644 (file)
@@ -96,12 +96,17 @@ Datum
 gbt_bytea_consistent(PG_FUNCTION_ARGS)
 {
        GISTENTRY  *entry = (GISTENTRY *) PG_GETARG_POINTER(0);
-       GBT_VARKEY *key = (GBT_VARKEY *) DatumGetPointer(entry->key);
        void       *query = (void *) DatumGetByteaP(PG_GETARG_DATUM(1));
        StrategyNumber strategy = (StrategyNumber) PG_GETARG_UINT16(2);
+       /* Oid          subtype = PG_GETARG_OID(3); */
+       bool       *recheck = (bool *) PG_GETARG_POINTER(4);
        bool            retval;
+       GBT_VARKEY *key = (GBT_VARKEY *) DatumGetPointer(entry->key);
        GBT_VARKEY_R r = gbt_var_key_readable(key);
 
+       /* All cases served by this function are exact */
+       *recheck = false;
+
        retval = gbt_var_consistent(&r, query, &strategy, GIST_LEAF(entry), &tinfo);
        PG_RETURN_BOOL(retval);
 }
index 13f8200fb74868cefe1036a16f81a1c3e75dda6e..eb618754d9aaefccca41377e4f4c763ab798e70e 100644 (file)
@@ -97,9 +97,14 @@ gbt_cash_consistent(PG_FUNCTION_ARGS)
 {
        GISTENTRY  *entry = (GISTENTRY *) PG_GETARG_POINTER(0);
        Cash            query = (*((Cash *) PG_GETARG_POINTER(1)));
+       StrategyNumber strategy = (StrategyNumber) PG_GETARG_UINT16(2);
+       /* Oid          subtype = PG_GETARG_OID(3); */
+       bool       *recheck = (bool *) PG_GETARG_POINTER(4);
        cashKEY    *kkk = (cashKEY *) DatumGetPointer(entry->key);
        GBT_NUMKEY_R key;
-       StrategyNumber strategy = (StrategyNumber) PG_GETARG_UINT16(2);
+
+       /* All cases served by this function are exact */
+       *recheck = false;
 
        key.lower = (GBT_NUMKEY *) & kkk->lower;
        key.upper = (GBT_NUMKEY *) & kkk->upper;
index b14888889dd6cdbb01e2561cb34ed5281072ef6a..212ee2d3972c0043eb29a3e0ea1aaaccf74f6fa4 100644 (file)
@@ -113,9 +113,14 @@ gbt_date_consistent(PG_FUNCTION_ARGS)
 {
        GISTENTRY  *entry = (GISTENTRY *) PG_GETARG_POINTER(0);
        DateADT         query = PG_GETARG_DATEADT(1);
+       StrategyNumber strategy = (StrategyNumber) PG_GETARG_UINT16(2);
+       /* Oid          subtype = PG_GETARG_OID(3); */
+       bool       *recheck = (bool *) PG_GETARG_POINTER(4);
        dateKEY    *kkk = (dateKEY *) DatumGetPointer(entry->key);
        GBT_NUMKEY_R key;
-       StrategyNumber strategy = (StrategyNumber) PG_GETARG_UINT16(2);
+
+       /* All cases served by this function are exact */
+       *recheck = false;
 
        key.lower = (GBT_NUMKEY *) & kkk->lower;
        key.upper = (GBT_NUMKEY *) & kkk->upper;
index a4c941f83595b38b851d38ef3056b48ccebdaf85..1aab392b80d306b71bbf7dda4ee59fd0218a423d 100644 (file)
@@ -96,9 +96,14 @@ gbt_float4_consistent(PG_FUNCTION_ARGS)
 {
        GISTENTRY  *entry = (GISTENTRY *) PG_GETARG_POINTER(0);
        float4          query = PG_GETARG_FLOAT4(1);
+       StrategyNumber strategy = (StrategyNumber) PG_GETARG_UINT16(2);
+       /* Oid          subtype = PG_GETARG_OID(3); */
+       bool       *recheck = (bool *) PG_GETARG_POINTER(4);
        float4KEY  *kkk = (float4KEY *) DatumGetPointer(entry->key);
        GBT_NUMKEY_R key;
-       StrategyNumber strategy = (StrategyNumber) PG_GETARG_UINT16(2);
+
+       /* All cases served by this function are exact */
+       *recheck = false;
 
        key.lower = (GBT_NUMKEY *) & kkk->lower;
        key.upper = (GBT_NUMKEY *) & kkk->upper;
index 1b87b4ee1b25c00eb1e0a26a71035e78eddaca42..3c804922cc1c9dd5c386a21a72d7bd00f057e2f7 100644 (file)
@@ -95,12 +95,16 @@ gbt_float8_compress(PG_FUNCTION_ARGS)
 Datum
 gbt_float8_consistent(PG_FUNCTION_ARGS)
 {
-
        GISTENTRY  *entry = (GISTENTRY *) PG_GETARG_POINTER(0);
        float8          query = PG_GETARG_FLOAT8(1);
+       StrategyNumber strategy = (StrategyNumber) PG_GETARG_UINT16(2);
+       /* Oid          subtype = PG_GETARG_OID(3); */
+       bool       *recheck = (bool *) PG_GETARG_POINTER(4);
        float8KEY  *kkk = (float8KEY *) DatumGetPointer(entry->key);
        GBT_NUMKEY_R key;
-       StrategyNumber strategy = (StrategyNumber) PG_GETARG_UINT16(2);
+
+       /* All cases served by this function are exact */
+       *recheck = false;
 
        key.lower = (GBT_NUMKEY *) & kkk->lower;
        key.upper = (GBT_NUMKEY *) & kkk->upper;
index d736b476c3dd3cf35bc084f3c6f4e7588b85ce21..c66536157a9ea76c371ff883802d924823815c4a 100644 (file)
@@ -94,7 +94,7 @@ CREATE TYPE gbtreekey_var (
 --
 --
 -- define the GiST support methods
-CREATE OR REPLACE FUNCTION gbt_oid_consistent(internal,oid,int2)
+CREATE OR REPLACE FUNCTION gbt_oid_consistent(internal,oid,int2,oid,internal)
 RETURNS bool
 AS 'MODULE_PATHNAME'
 LANGUAGE C IMMUTABLE;
@@ -143,7 +143,7 @@ AS
        OPERATOR        3       =  ,
        OPERATOR        4       >= ,
        OPERATOR        5       >  ,
-       FUNCTION        1       gbt_oid_consistent (internal, oid, int2),
+       FUNCTION        1       gbt_oid_consistent (internal, oid, int2, oid, internal),
        FUNCTION        2       gbt_oid_union (bytea, internal),
        FUNCTION        3       gbt_oid_compress (internal),
        FUNCTION        4       gbt_decompress (internal),
@@ -161,7 +161,7 @@ AS
 --
 --
 -- define the GiST support methods
-CREATE OR REPLACE FUNCTION gbt_int2_consistent(internal,int2,int2)
+CREATE OR REPLACE FUNCTION gbt_int2_consistent(internal,int2,int2,oid,internal)
 RETURNS bool
 AS 'MODULE_PATHNAME'
 LANGUAGE C IMMUTABLE;
@@ -200,7 +200,7 @@ AS
        OPERATOR        3       =  ,
        OPERATOR        4       >= ,
        OPERATOR        5       >  ,
-       FUNCTION        1       gbt_int2_consistent (internal, int2, int2),
+       FUNCTION        1       gbt_int2_consistent (internal, int2, int2, oid, internal),
        FUNCTION        2       gbt_int2_union (bytea, internal),
        FUNCTION        3       gbt_int2_compress (internal),
        FUNCTION        4       gbt_decompress (internal),
@@ -217,7 +217,7 @@ AS
 --
 --
 -- define the GiST support methods
-CREATE OR REPLACE FUNCTION gbt_int4_consistent(internal,int4,int2)
+CREATE OR REPLACE FUNCTION gbt_int4_consistent(internal,int4,int2,oid,internal)
 RETURNS bool
 AS 'MODULE_PATHNAME'
 LANGUAGE C IMMUTABLE;
@@ -256,7 +256,7 @@ AS
        OPERATOR        3       =  ,
        OPERATOR        4       >= ,
        OPERATOR        5       >  ,
-       FUNCTION        1       gbt_int4_consistent (internal, int4, int2),
+       FUNCTION        1       gbt_int4_consistent (internal, int4, int2, oid, internal),
        FUNCTION        2       gbt_int4_union (bytea, internal),
        FUNCTION        3       gbt_int4_compress (internal),
        FUNCTION        4       gbt_decompress (internal),
@@ -273,7 +273,7 @@ AS
 --
 --
 -- define the GiST support methods
-CREATE OR REPLACE FUNCTION gbt_int8_consistent(internal,int8,int2)
+CREATE OR REPLACE FUNCTION gbt_int8_consistent(internal,int8,int2,oid,internal)
 RETURNS bool
 AS 'MODULE_PATHNAME'
 LANGUAGE C IMMUTABLE;
@@ -312,7 +312,7 @@ AS
        OPERATOR        3       =  ,
        OPERATOR        4       >= ,
        OPERATOR        5       >  ,
-       FUNCTION        1       gbt_int8_consistent (internal, int8, int2),
+       FUNCTION        1       gbt_int8_consistent (internal, int8, int2, oid, internal),
        FUNCTION        2       gbt_int8_union (bytea, internal),
        FUNCTION        3       gbt_int8_compress (internal),
        FUNCTION        4       gbt_decompress (internal),
@@ -330,7 +330,7 @@ AS
 --
 --
 -- define the GiST support methods
-CREATE OR REPLACE FUNCTION gbt_float4_consistent(internal,float4,int2)
+CREATE OR REPLACE FUNCTION gbt_float4_consistent(internal,float4,int2,oid,internal)
 RETURNS bool
 AS 'MODULE_PATHNAME'
 LANGUAGE C IMMUTABLE;
@@ -369,7 +369,7 @@ AS
        OPERATOR        3       =  ,
        OPERATOR        4       >= ,
        OPERATOR        5       >  ,
-       FUNCTION        1       gbt_float4_consistent (internal, float4, int2),
+       FUNCTION        1       gbt_float4_consistent (internal, float4, int2, oid, internal),
        FUNCTION        2       gbt_float4_union (bytea, internal),
        FUNCTION        3       gbt_float4_compress (internal),
        FUNCTION        4       gbt_decompress (internal),
@@ -389,7 +389,7 @@ AS
 --
 --
 -- define the GiST support methods
-CREATE OR REPLACE FUNCTION gbt_float8_consistent(internal,float8,int2)
+CREATE OR REPLACE FUNCTION gbt_float8_consistent(internal,float8,int2,oid,internal)
 RETURNS bool
 AS 'MODULE_PATHNAME'
 LANGUAGE C IMMUTABLE;
@@ -428,7 +428,7 @@ AS
        OPERATOR        3       =  ,
        OPERATOR        4       >= ,
        OPERATOR        5       >  ,
-       FUNCTION        1       gbt_float8_consistent (internal, float8, int2),
+       FUNCTION        1       gbt_float8_consistent (internal, float8, int2, oid, internal),
        FUNCTION        2       gbt_float8_union (bytea, internal),
        FUNCTION        3       gbt_float8_compress (internal),
        FUNCTION        4       gbt_decompress (internal),
@@ -446,12 +446,12 @@ AS
 --
 --
 
-CREATE OR REPLACE FUNCTION gbt_ts_consistent(internal,timestamp,int2)
+CREATE OR REPLACE FUNCTION gbt_ts_consistent(internal,timestamp,int2,oid,internal)
 RETURNS bool
 AS 'MODULE_PATHNAME'
 LANGUAGE C IMMUTABLE;
 
-CREATE OR REPLACE FUNCTION gbt_tstz_consistent(internal,timestamptz,int2)
+CREATE OR REPLACE FUNCTION gbt_tstz_consistent(internal,timestamptz,int2,oid,internal)
 RETURNS bool
 AS 'MODULE_PATHNAME'
 LANGUAGE C IMMUTABLE;
@@ -495,7 +495,7 @@ AS
        OPERATOR        3       =  ,
        OPERATOR        4       >= ,
        OPERATOR        5       >  ,
-       FUNCTION        1       gbt_ts_consistent (internal, timestamp, int2),
+       FUNCTION        1       gbt_ts_consistent (internal, timestamp, int2, oid, internal),
        FUNCTION        2       gbt_ts_union (bytea, internal),
        FUNCTION        3       gbt_ts_compress (internal),
        FUNCTION        4       gbt_decompress (internal),
@@ -514,7 +514,7 @@ AS
        OPERATOR        3       =  ,
        OPERATOR        4       >= ,
        OPERATOR        5       >  ,
-       FUNCTION        1       gbt_tstz_consistent (internal, timestamptz, int2),
+       FUNCTION        1       gbt_tstz_consistent (internal, timestamptz, int2, oid, internal),
        FUNCTION        2       gbt_ts_union (bytea, internal),
        FUNCTION        3       gbt_tstz_compress (internal),
        FUNCTION        4       gbt_decompress (internal),
@@ -532,12 +532,12 @@ AS
 --
 --
 
-CREATE OR REPLACE FUNCTION gbt_time_consistent(internal,time,int2)
+CREATE OR REPLACE FUNCTION gbt_time_consistent(internal,time,int2,oid,internal)
 RETURNS bool
 AS 'MODULE_PATHNAME'
 LANGUAGE C IMMUTABLE;
 
-CREATE OR REPLACE FUNCTION gbt_timetz_consistent(internal,timetz,int2)
+CREATE OR REPLACE FUNCTION gbt_timetz_consistent(internal,timetz,int2,oid,internal)
 RETURNS bool
 AS 'MODULE_PATHNAME'
 LANGUAGE C IMMUTABLE;
@@ -581,7 +581,7 @@ AS
        OPERATOR        3       =  ,
        OPERATOR        4       >= ,
        OPERATOR        5       >  ,
-       FUNCTION        1       gbt_time_consistent (internal, time, int2),
+       FUNCTION        1       gbt_time_consistent (internal, time, int2, oid, internal),
        FUNCTION        2       gbt_time_union (bytea, internal),
        FUNCTION        3       gbt_time_compress (internal),
        FUNCTION        4       gbt_decompress (internal),
@@ -593,12 +593,12 @@ AS
 CREATE OPERATOR CLASS gist_timetz_ops
 DEFAULT FOR TYPE timetz USING gist 
 AS
-       OPERATOR        1       <   RECHECK ,
-       OPERATOR        2       <=  RECHECK ,
-       OPERATOR        3       =   RECHECK ,
-       OPERATOR        4       >=  RECHECK ,
-       OPERATOR        5       >   RECHECK ,
-       FUNCTION        1       gbt_timetz_consistent (internal, timetz, int2),
+       OPERATOR        1       <   ,
+       OPERATOR        2       <=  ,
+       OPERATOR        3       =   ,
+       OPERATOR        4       >=  ,
+       OPERATOR        5       >   ,
+       FUNCTION        1       gbt_timetz_consistent (internal, timetz, int2, oid, internal),
        FUNCTION        2       gbt_time_union (bytea, internal),
        FUNCTION        3       gbt_timetz_compress (internal),
        FUNCTION        4       gbt_decompress (internal),
@@ -616,7 +616,7 @@ AS
 --
 --
 
-CREATE OR REPLACE FUNCTION gbt_date_consistent(internal,date,int2)
+CREATE OR REPLACE FUNCTION gbt_date_consistent(internal,date,int2,oid,internal)
 RETURNS bool
 AS 'MODULE_PATHNAME'
 LANGUAGE C IMMUTABLE;
@@ -655,7 +655,7 @@ AS
        OPERATOR        3       =  ,
        OPERATOR        4       >= ,
        OPERATOR        5       >  ,
-       FUNCTION        1       gbt_date_consistent (internal, date, int2),
+       FUNCTION        1       gbt_date_consistent (internal, date, int2, oid, internal),
        FUNCTION        2       gbt_date_union (bytea, internal),
        FUNCTION        3       gbt_date_compress (internal),
        FUNCTION        4       gbt_decompress (internal),
@@ -673,7 +673,7 @@ AS
 --
 --
 
-CREATE OR REPLACE FUNCTION gbt_intv_consistent(internal,interval,int2)
+CREATE OR REPLACE FUNCTION gbt_intv_consistent(internal,interval,int2,oid,internal)
 RETURNS bool
 AS 'MODULE_PATHNAME'
 LANGUAGE C IMMUTABLE;
@@ -717,7 +717,7 @@ AS
        OPERATOR        3       = ,
        OPERATOR        4       >= ,
        OPERATOR        5       > ,
-       FUNCTION        1       gbt_intv_consistent (internal, interval, int2),
+       FUNCTION        1       gbt_intv_consistent (internal, interval, int2, oid, internal),
        FUNCTION        2       gbt_intv_union (bytea, internal),
        FUNCTION        3       gbt_intv_compress (internal),
        FUNCTION        4       gbt_intv_decompress (internal),
@@ -734,7 +734,7 @@ AS
 --
 --
 -- define the GiST support methods
-CREATE OR REPLACE FUNCTION gbt_cash_consistent(internal,money,int2)
+CREATE OR REPLACE FUNCTION gbt_cash_consistent(internal,money,int2,oid,internal)
 RETURNS bool
 AS 'MODULE_PATHNAME'
 LANGUAGE C IMMUTABLE;
@@ -773,7 +773,7 @@ AS
        OPERATOR        3       = ,
        OPERATOR        4       >= ,
        OPERATOR        5       > ,
-       FUNCTION        1       gbt_cash_consistent (internal, money, int2),
+       FUNCTION        1       gbt_cash_consistent (internal, money, int2, oid, internal),
        FUNCTION        2       gbt_cash_union (bytea, internal),
        FUNCTION        3       gbt_cash_compress (internal),
        FUNCTION        4       gbt_decompress (internal),
@@ -790,7 +790,7 @@ AS
 --
 --
 -- define the GiST support methods
-CREATE OR REPLACE FUNCTION gbt_macad_consistent(internal,macaddr,int2)
+CREATE OR REPLACE FUNCTION gbt_macad_consistent(internal,macaddr,int2,oid,internal)
 RETURNS bool
 AS 'MODULE_PATHNAME'
 LANGUAGE C IMMUTABLE;
@@ -829,7 +829,7 @@ AS
        OPERATOR        3       = ,
        OPERATOR        4       >= ,
        OPERATOR        5       > ,
-       FUNCTION        1       gbt_macad_consistent (internal, macaddr, int2),
+       FUNCTION        1       gbt_macad_consistent (internal, macaddr, int2, oid, internal),
        FUNCTION        2       gbt_macad_union (bytea, internal),
        FUNCTION        3       gbt_macad_compress (internal),
        FUNCTION        4       gbt_decompress (internal),
@@ -848,12 +848,12 @@ AS
 --
 --
 -- define the GiST support methods
-CREATE OR REPLACE FUNCTION gbt_text_consistent(internal,text,int2)
+CREATE OR REPLACE FUNCTION gbt_text_consistent(internal,text,int2,oid,internal)
 RETURNS bool
 AS 'MODULE_PATHNAME'
 LANGUAGE C IMMUTABLE;
 
-CREATE OR REPLACE FUNCTION gbt_bpchar_consistent(internal,bpchar,int2)
+CREATE OR REPLACE FUNCTION gbt_bpchar_consistent(internal,bpchar,int2,oid,internal)
 RETURNS bool
 AS 'MODULE_PATHNAME'
 LANGUAGE C IMMUTABLE;
@@ -897,7 +897,7 @@ AS
        OPERATOR        3       =  ,
        OPERATOR        4       >= ,
        OPERATOR        5       >  ,
-       FUNCTION        1       gbt_text_consistent (internal, text, int2),
+       FUNCTION        1       gbt_text_consistent (internal, text, int2, oid, internal),
        FUNCTION        2       gbt_text_union (bytea, internal),
        FUNCTION        3       gbt_text_compress (internal),
        FUNCTION        4       gbt_var_decompress (internal),
@@ -916,7 +916,7 @@ AS
        OPERATOR        3       =  ,
        OPERATOR        4       >= ,
        OPERATOR        5       >  ,
-       FUNCTION        1       gbt_bpchar_consistent (internal, bpchar , int2),
+       FUNCTION        1       gbt_bpchar_consistent (internal, bpchar , int2, oid, internal),
        FUNCTION        2       gbt_text_union (bytea, internal),
        FUNCTION        3       gbt_bpchar_compress (internal),
        FUNCTION        4       gbt_var_decompress (internal),
@@ -934,7 +934,7 @@ AS
 --
 --
 -- define the GiST support methods
-CREATE OR REPLACE FUNCTION gbt_bytea_consistent(internal,bytea,int2)
+CREATE OR REPLACE FUNCTION gbt_bytea_consistent(internal,bytea,int2,oid,internal)
 RETURNS bool
 AS 'MODULE_PATHNAME'
 LANGUAGE C IMMUTABLE;
@@ -973,7 +973,7 @@ AS
        OPERATOR        3       =  ,
        OPERATOR        4       >= ,
        OPERATOR        5       >  ,
-       FUNCTION        1       gbt_bytea_consistent (internal, bytea, int2),
+       FUNCTION        1       gbt_bytea_consistent (internal, bytea, int2, oid, internal),
        FUNCTION        2       gbt_bytea_union (bytea, internal),
        FUNCTION        3       gbt_bytea_compress (internal),
        FUNCTION        4       gbt_var_decompress (internal),
@@ -991,7 +991,7 @@ AS
 --
 --
 -- define the GiST support methods
-CREATE OR REPLACE FUNCTION gbt_numeric_consistent(internal,numeric,int2)
+CREATE OR REPLACE FUNCTION gbt_numeric_consistent(internal,numeric,int2,oid,internal)
 RETURNS bool
 AS 'MODULE_PATHNAME'
 LANGUAGE C IMMUTABLE;
@@ -1030,7 +1030,7 @@ AS
        OPERATOR        3       =  ,
        OPERATOR        4       >= ,
        OPERATOR        5       >  ,
-       FUNCTION        1       gbt_numeric_consistent (internal, numeric, int2),
+       FUNCTION        1       gbt_numeric_consistent (internal, numeric, int2, oid, internal),
        FUNCTION        2       gbt_numeric_union (bytea, internal),
        FUNCTION        3       gbt_numeric_compress (internal),
        FUNCTION        4       gbt_var_decompress (internal),
@@ -1046,7 +1046,7 @@ AS
 --
 --
 -- define the GiST support methods
-CREATE OR REPLACE FUNCTION gbt_bit_consistent(internal,bit,int2)
+CREATE OR REPLACE FUNCTION gbt_bit_consistent(internal,bit,int2,oid,internal)
 RETURNS bool
 AS 'MODULE_PATHNAME'
 LANGUAGE C IMMUTABLE;
@@ -1085,7 +1085,7 @@ AS
        OPERATOR        3       =  ,
        OPERATOR        4       >= ,
        OPERATOR        5       >  ,
-       FUNCTION        1       gbt_bit_consistent (internal, bit, int2),
+       FUNCTION        1       gbt_bit_consistent (internal, bit, int2, oid, internal),
        FUNCTION        2       gbt_bit_union (bytea, internal),
        FUNCTION        3       gbt_bit_compress (internal),
        FUNCTION        4       gbt_var_decompress (internal),
@@ -1104,7 +1104,7 @@ AS
        OPERATOR        3       =  ,
        OPERATOR        4       >= ,
        OPERATOR        5       >  ,
-       FUNCTION        1       gbt_bit_consistent (internal, bit, int2),
+       FUNCTION        1       gbt_bit_consistent (internal, bit, int2, oid, internal),
        FUNCTION        2       gbt_bit_union (bytea, internal),
        FUNCTION        3       gbt_bit_compress (internal),
        FUNCTION        4       gbt_var_decompress (internal),
@@ -1123,7 +1123,7 @@ AS
 --
 --
 -- define the GiST support methods
-CREATE OR REPLACE FUNCTION gbt_inet_consistent(internal,inet,int2)
+CREATE OR REPLACE FUNCTION gbt_inet_consistent(internal,inet,int2,oid,internal)
 RETURNS bool
 AS 'MODULE_PATHNAME'
 LANGUAGE C IMMUTABLE;
@@ -1157,12 +1157,12 @@ LANGUAGE C IMMUTABLE;
 CREATE OPERATOR CLASS gist_inet_ops
 DEFAULT FOR TYPE inet USING gist 
 AS
-       OPERATOR        1       <   RECHECK ,
-       OPERATOR        2       <=  RECHECK ,
-       OPERATOR        3       =   RECHECK ,
-       OPERATOR        4       >=  RECHECK ,
-       OPERATOR        5       >   RECHECK ,
-       FUNCTION        1       gbt_inet_consistent (internal, inet, int2),
+       OPERATOR        1       <   ,
+       OPERATOR        2       <=  ,
+       OPERATOR        3       =   ,
+       OPERATOR        4       >=  ,
+       OPERATOR        5       >   ,
+       FUNCTION        1       gbt_inet_consistent (internal, inet, int2, oid, internal),
        FUNCTION        2       gbt_inet_union (bytea, internal),
        FUNCTION        3       gbt_inet_compress (internal),
        FUNCTION        4       gbt_decompress (internal),
@@ -1175,12 +1175,12 @@ AS
 CREATE OPERATOR CLASS gist_cidr_ops
 DEFAULT FOR TYPE cidr USING gist 
 AS
-       OPERATOR        1       <  (inet, inet)  RECHECK ,
-       OPERATOR        2       <= (inet, inet)  RECHECK ,
-       OPERATOR        3       =  (inet, inet)  RECHECK ,
-       OPERATOR        4       >= (inet, inet)  RECHECK ,
-       OPERATOR        5       >  (inet, inet)  RECHECK ,
-       FUNCTION        1       gbt_inet_consistent (internal, inet, int2),
+       OPERATOR        1       <  (inet, inet)  ,
+       OPERATOR        2       <= (inet, inet)  ,
+       OPERATOR        3       =  (inet, inet)  ,
+       OPERATOR        4       >= (inet, inet)  ,
+       OPERATOR        5       >  (inet, inet)  ,
+       FUNCTION        1       gbt_inet_consistent (internal, inet, int2, oid, internal),
        FUNCTION        2       gbt_inet_union (bytea, internal),
        FUNCTION        3       gbt_inet_compress (internal),
        FUNCTION        4       gbt_decompress (internal),
index 914f4f6d5ef8cf4331306c31e8f95ab3bebc898d..b54e1c112f7f13e27ef8d8f95a9bd96979869c7a 100644 (file)
@@ -115,9 +115,14 @@ gbt_inet_consistent(PG_FUNCTION_ARGS)
        GISTENTRY  *entry = (GISTENTRY *) PG_GETARG_POINTER(0);
        double          query = convert_network_to_scalar(PG_GETARG_DATUM(1), INETOID);
        StrategyNumber strategy = (StrategyNumber) PG_GETARG_UINT16(2);
+       /* Oid          subtype = PG_GETARG_OID(3); */
+       bool       *recheck = (bool *) PG_GETARG_POINTER(4);
        inetKEY    *kkk = (inetKEY *) DatumGetPointer(entry->key);
        GBT_NUMKEY_R key;
 
+       /* All cases served by this function are inexact */
+       *recheck = true;
+
        key.lower = (GBT_NUMKEY *) & kkk->lower;
        key.upper = (GBT_NUMKEY *) & kkk->upper;
 
index 5e2a66526e5591854fbccd5a66af0365c8c793ea..b129130c2c40cf0560e0c50c061ea087485577fd 100644 (file)
@@ -100,9 +100,14 @@ gbt_int2_consistent(PG_FUNCTION_ARGS)
 {
        GISTENTRY  *entry = (GISTENTRY *) PG_GETARG_POINTER(0);
        int16           query = PG_GETARG_INT16(1);
+       StrategyNumber strategy = (StrategyNumber) PG_GETARG_UINT16(2);
+       /* Oid          subtype = PG_GETARG_OID(3); */
+       bool       *recheck = (bool *) PG_GETARG_POINTER(4);
        int16KEY   *kkk = (int16KEY *) DatumGetPointer(entry->key);
        GBT_NUMKEY_R key;
-       StrategyNumber strategy = (StrategyNumber) PG_GETARG_UINT16(2);
+
+       /* All cases served by this function are exact */
+       *recheck = false;
 
        key.lower = (GBT_NUMKEY *) & kkk->lower;
        key.upper = (GBT_NUMKEY *) & kkk->upper;
index 6a69b85bdd91fc8024bcfbaaea3ed607894b70b2..c07c9a1e2c2975274608608a470663f9e810f933 100644 (file)
@@ -95,12 +95,16 @@ gbt_int4_compress(PG_FUNCTION_ARGS)
 Datum
 gbt_int4_consistent(PG_FUNCTION_ARGS)
 {
-
        GISTENTRY  *entry = (GISTENTRY *) PG_GETARG_POINTER(0);
        int32           query = PG_GETARG_INT32(1);
+       StrategyNumber strategy = (StrategyNumber) PG_GETARG_UINT16(2);
+       /* Oid          subtype = PG_GETARG_OID(3); */
+       bool       *recheck = (bool *) PG_GETARG_POINTER(4);
        int32KEY   *kkk = (int32KEY *) DatumGetPointer(entry->key);
        GBT_NUMKEY_R key;
-       StrategyNumber strategy = (StrategyNumber) PG_GETARG_UINT16(2);
+
+       /* All cases served by this function are exact */
+       *recheck = false;
 
        key.lower = (GBT_NUMKEY *) & kkk->lower;
        key.upper = (GBT_NUMKEY *) & kkk->upper;
index 83275f2c7a79faf03fff59b7b73083d7ba1180c0..3466e1c115610d5f110e3f243abfc234708d6c91 100644 (file)
@@ -97,9 +97,14 @@ gbt_int8_consistent(PG_FUNCTION_ARGS)
 {
        GISTENTRY  *entry = (GISTENTRY *) PG_GETARG_POINTER(0);
        int64           query = PG_GETARG_INT64(1);
+       StrategyNumber strategy = (StrategyNumber) PG_GETARG_UINT16(2);
+       /* Oid          subtype = PG_GETARG_OID(3); */
+       bool       *recheck = (bool *) PG_GETARG_POINTER(4);
        int64KEY   *kkk = (int64KEY *) DatumGetPointer(entry->key);
        GBT_NUMKEY_R key;
-       StrategyNumber strategy = (StrategyNumber) PG_GETARG_UINT16(2);
+
+       /* All cases served by this function are exact */
+       *recheck = false;
 
        key.lower = (GBT_NUMKEY *) & kkk->lower;
        key.upper = (GBT_NUMKEY *) & kkk->upper;
index 09c6be5487a7543e2480a24df8da5210ce72ce4e..232ba20531fa4295563f2d3bfe6c1e8d249be89f 100644 (file)
@@ -165,9 +165,14 @@ gbt_intv_consistent(PG_FUNCTION_ARGS)
 {
        GISTENTRY  *entry = (GISTENTRY *) PG_GETARG_POINTER(0);
        Interval   *query = PG_GETARG_INTERVAL_P(1);
+       StrategyNumber strategy = (StrategyNumber) PG_GETARG_UINT16(2);
+       /* Oid          subtype = PG_GETARG_OID(3); */
+       bool       *recheck = (bool *) PG_GETARG_POINTER(4);
        intvKEY    *kkk = (intvKEY *) DatumGetPointer(entry->key);
        GBT_NUMKEY_R key;
-       StrategyNumber strategy = (StrategyNumber) PG_GETARG_UINT16(2);
+
+       /* All cases served by this function are exact */
+       *recheck = false;
 
        key.lower = (GBT_NUMKEY *) & kkk->lower;
        key.upper = (GBT_NUMKEY *) & kkk->upper;
index 52cf4cb1d48858c5294da125d2207f7ce981c06d..5bdc9eb3bd0814feb8085edf46159fa812f478d4 100644 (file)
@@ -116,12 +116,16 @@ gbt_macad_compress(PG_FUNCTION_ARGS)
 Datum
 gbt_macad_consistent(PG_FUNCTION_ARGS)
 {
-
        GISTENTRY  *entry = (GISTENTRY *) PG_GETARG_POINTER(0);
        macaddr    *query = (macaddr *) PG_GETARG_POINTER(1);
+       StrategyNumber strategy = (StrategyNumber) PG_GETARG_UINT16(2);
+       /* Oid          subtype = PG_GETARG_OID(3); */
+       bool       *recheck = (bool *) PG_GETARG_POINTER(4);
        macKEY     *kkk = (macKEY *) DatumGetPointer(entry->key);
        GBT_NUMKEY_R key;
-       StrategyNumber strategy = (StrategyNumber) PG_GETARG_UINT16(2);
+
+       /* All cases served by this function are exact */
+       *recheck = false;
 
        key.lower = (GBT_NUMKEY *) & kkk->lower;
        key.upper = (GBT_NUMKEY *) & kkk->upper;
index 639b575cb3f7fa4a1afe1a839f8c26eb969a47d0..a1fcf602c0eb0583c581cfa013d4f2bb7aa42ffb 100644 (file)
@@ -99,14 +99,18 @@ gbt_numeric_compress(PG_FUNCTION_ARGS)
 Datum
 gbt_numeric_consistent(PG_FUNCTION_ARGS)
 {
-
        GISTENTRY  *entry = (GISTENTRY *) PG_GETARG_POINTER(0);
-       GBT_VARKEY *key = (GBT_VARKEY *) DatumGetPointer(entry->key);
        void       *query = (void *) DatumGetNumeric(PG_GETARG_DATUM(1));
        StrategyNumber strategy = (StrategyNumber) PG_GETARG_UINT16(2);
+       /* Oid          subtype = PG_GETARG_OID(3); */
+       bool       *recheck = (bool *) PG_GETARG_POINTER(4);
        bool            retval;
+       GBT_VARKEY *key = (GBT_VARKEY *) DatumGetPointer(entry->key);
        GBT_VARKEY_R r = gbt_var_key_readable(key);
 
+       /* All cases served by this function are exact */
+       *recheck = false;
+
        retval = gbt_var_consistent(&r, query, &strategy, GIST_LEAF(entry), &tinfo);
        PG_RETURN_BOOL(retval);
 }
index 979d728a73d21b1c786989a11284761574fe7079..119035cad608dbad5241687db1ee47604efaf50d 100644 (file)
@@ -95,12 +95,16 @@ gbt_oid_compress(PG_FUNCTION_ARGS)
 Datum
 gbt_oid_consistent(PG_FUNCTION_ARGS)
 {
-
        GISTENTRY  *entry = (GISTENTRY *) PG_GETARG_POINTER(0);
        Oid                     query = PG_GETARG_OID(1);
+       StrategyNumber strategy = (StrategyNumber) PG_GETARG_UINT16(2);
+       /* Oid          subtype = PG_GETARG_OID(3); */
+       bool       *recheck = (bool *) PG_GETARG_POINTER(4);
        oidKEY     *kkk = (oidKEY *) DatumGetPointer(entry->key);
        GBT_NUMKEY_R key;
-       StrategyNumber strategy = (StrategyNumber) PG_GETARG_UINT16(2);
+
+       /* All cases served by this function are exact */
+       *recheck = false;
 
        key.lower = (GBT_NUMKEY *) & kkk->lower;
        key.upper = (GBT_NUMKEY *) & kkk->upper;
index fa4eb904f504b534cd80994b2e1f3b79aec7aa85..7951d055d3d2e1fd4810661535a91498efef8bd5 100644 (file)
@@ -130,12 +130,17 @@ Datum
 gbt_text_consistent(PG_FUNCTION_ARGS)
 {
        GISTENTRY  *entry = (GISTENTRY *) PG_GETARG_POINTER(0);
-       GBT_VARKEY *key = (GBT_VARKEY *) DatumGetPointer(entry->key);
        void       *query = (void *) DatumGetTextP(PG_GETARG_DATUM(1));
        StrategyNumber strategy = (StrategyNumber) PG_GETARG_UINT16(2);
-       bool            retval = FALSE;
+       /* Oid          subtype = PG_GETARG_OID(3); */
+       bool       *recheck = (bool *) PG_GETARG_POINTER(4);
+       bool            retval;
+       GBT_VARKEY *key = (GBT_VARKEY *) DatumGetPointer(entry->key);
        GBT_VARKEY_R r = gbt_var_key_readable(key);
 
+       /* All cases served by this function are exact */
+       *recheck = false;
+
        if (tinfo.eml == 0)
        {
                tinfo.eml = pg_database_encoding_max_length();
@@ -151,12 +156,17 @@ Datum
 gbt_bpchar_consistent(PG_FUNCTION_ARGS)
 {
        GISTENTRY  *entry = (GISTENTRY *) PG_GETARG_POINTER(0);
-       GBT_VARKEY *key = (GBT_VARKEY *) DatumGetPointer(entry->key);
        void       *query = (void *) DatumGetPointer(PG_DETOAST_DATUM(PG_GETARG_DATUM(1)));
-       void       *trim = (void *) DatumGetPointer(DirectFunctionCall1(rtrim1, PointerGetDatum(query)));
        StrategyNumber strategy = (StrategyNumber) PG_GETARG_UINT16(2);
+       /* Oid          subtype = PG_GETARG_OID(3); */
+       bool       *recheck = (bool *) PG_GETARG_POINTER(4);
        bool            retval;
+       GBT_VARKEY *key = (GBT_VARKEY *) DatumGetPointer(entry->key);
        GBT_VARKEY_R r = gbt_var_key_readable(key);
+       void       *trim = (void *) DatumGetPointer(DirectFunctionCall1(rtrim1, PointerGetDatum(query)));
+
+       /* All cases served by this function are exact */
+       *recheck = false;
 
        if (tinfo.eml == 0)
        {
index fd5e63e2bbc7cd5aa6283cec3ffe5129bf583c30..6c1ec80a314264d7ccbbe57f1dd2686478d1f5be 100644 (file)
@@ -151,14 +151,18 @@ gbt_time_consistent(PG_FUNCTION_ARGS)
 {
        GISTENTRY  *entry = (GISTENTRY *) PG_GETARG_POINTER(0);
        TimeADT         query = PG_GETARG_TIMEADT(1);
+       StrategyNumber strategy = (StrategyNumber) PG_GETARG_UINT16(2);
+       /* Oid          subtype = PG_GETARG_OID(3); */
+       bool       *recheck = (bool *) PG_GETARG_POINTER(4);
        timeKEY    *kkk = (timeKEY *) DatumGetPointer(entry->key);
        GBT_NUMKEY_R key;
-       StrategyNumber strategy = (StrategyNumber) PG_GETARG_UINT16(2);
+
+       /* All cases served by this function are exact */
+       *recheck = false;
 
        key.lower = (GBT_NUMKEY *) & kkk->lower;
        key.upper = (GBT_NUMKEY *) & kkk->upper;
 
-
        PG_RETURN_BOOL(
                                   gbt_num_consistent(&key, (void *) &query, &strategy, GIST_LEAF(entry), &tinfo)
                );
@@ -170,11 +174,15 @@ gbt_timetz_consistent(PG_FUNCTION_ARGS)
        GISTENTRY  *entry = (GISTENTRY *) PG_GETARG_POINTER(0);
        TimeTzADT  *query = PG_GETARG_TIMETZADT_P(1);
        StrategyNumber strategy = (StrategyNumber) PG_GETARG_UINT16(2);
-
+       /* Oid          subtype = PG_GETARG_OID(3); */
+       bool       *recheck = (bool *) PG_GETARG_POINTER(4);
        timeKEY    *kkk = (timeKEY *) DatumGetPointer(entry->key);
        TimeADT         qqq;
        GBT_NUMKEY_R key;
 
+       /* All cases served by this function are inexact */
+       *recheck = true;
+
 #ifdef HAVE_INT64_TIMESTAMP
        qqq = query->time + (query->zone * INT64CONST(1000000));
 #else
index 9a7d6505279510e71364cd673bac75ab71410b8a..606a986a70db0f2d7600982cb59376aee7ebeaef 100644 (file)
@@ -173,9 +173,14 @@ gbt_ts_consistent(PG_FUNCTION_ARGS)
 {
        GISTENTRY  *entry = (GISTENTRY *) PG_GETARG_POINTER(0);
        Timestamp  *query = (Timestamp *) PG_GETARG_POINTER(1);
+       StrategyNumber strategy = (StrategyNumber) PG_GETARG_UINT16(2);
+       /* Oid          subtype = PG_GETARG_OID(3); */
+       bool       *recheck = (bool *) PG_GETARG_POINTER(4);
        tsKEY      *kkk = (tsKEY *) DatumGetPointer(entry->key);
        GBT_NUMKEY_R key;
-       StrategyNumber strategy = (StrategyNumber) PG_GETARG_UINT16(2);
+
+       /* All cases served by this function are exact */
+       *recheck = false;
 
        key.lower = (GBT_NUMKEY *) & kkk->lower;
        key.upper = (GBT_NUMKEY *) & kkk->upper;
@@ -190,11 +195,16 @@ gbt_tstz_consistent(PG_FUNCTION_ARGS)
 {
        GISTENTRY  *entry = (GISTENTRY *) PG_GETARG_POINTER(0);
        TimestampTz *query = (Timestamp *) PG_GETARG_POINTER(1);
+       StrategyNumber strategy = (StrategyNumber) PG_GETARG_UINT16(2);
+       /* Oid          subtype = PG_GETARG_OID(3); */
+       bool       *recheck = (bool *) PG_GETARG_POINTER(4);
        char       *kkk = (char *) DatumGetPointer(entry->key);
        GBT_NUMKEY_R key;
-       StrategyNumber strategy = (StrategyNumber) PG_GETARG_UINT16(2);
        Timestamp       qqq;
 
+       /* All cases served by this function are exact */
+       *recheck = false;
+
        key.lower = (GBT_NUMKEY *) & kkk[0];
        key.upper = (GBT_NUMKEY *) & kkk[MAXALIGN(tinfo.size)];
        tstz_to_ts_gmt(&qqq, query);
index b63c021ce3c91e8a7206d993f5dfe16f3fe917ee..72508d331ef89f72b9f84bb2b468afe059926f5e 100644 (file)
@@ -17,7 +17,7 @@ DROP FUNCTION gbt_inet_penalty(internal,internal,internal);
 
 DROP FUNCTION gbt_inet_compress(internal);
 
-DROP FUNCTION gbt_inet_consistent(internal,inet,int2);
+DROP FUNCTION gbt_inet_consistent(internal,inet,int2,oid,internal);
 
 DROP OPERATOR CLASS gist_vbit_ops USING gist;
 
@@ -33,7 +33,7 @@ DROP FUNCTION gbt_bit_penalty(internal,internal,internal);
 
 DROP FUNCTION gbt_bit_compress(internal);
 
-DROP FUNCTION gbt_bit_consistent(internal,bit,int2);
+DROP FUNCTION gbt_bit_consistent(internal,bit,int2,oid,internal);
 
 DROP OPERATOR CLASS gist_numeric_ops USING gist;
 
@@ -47,7 +47,7 @@ DROP FUNCTION gbt_numeric_penalty(internal,internal,internal);
 
 DROP FUNCTION gbt_numeric_compress(internal);
 
-DROP FUNCTION gbt_numeric_consistent(internal,numeric,int2);
+DROP FUNCTION gbt_numeric_consistent(internal,numeric,int2,oid,internal);
 
 DROP OPERATOR CLASS gist_bytea_ops USING gist;
 
@@ -61,7 +61,7 @@ DROP FUNCTION gbt_bytea_penalty(internal,internal,internal);
 
 DROP FUNCTION gbt_bytea_compress(internal);
 
-DROP FUNCTION gbt_bytea_consistent(internal,bytea,int2);
+DROP FUNCTION gbt_bytea_consistent(internal,bytea,int2,oid,internal);
 
 DROP OPERATOR CLASS gist_bpchar_ops USING gist;
 
@@ -79,9 +79,9 @@ DROP FUNCTION gbt_bpchar_compress(internal);
 
 DROP FUNCTION gbt_text_compress(internal);
 
-DROP FUNCTION gbt_bpchar_consistent(internal,bpchar,int2);
+DROP FUNCTION gbt_bpchar_consistent(internal,bpchar,int2,oid,internal);
 
-DROP FUNCTION gbt_text_consistent(internal,text,int2);
+DROP FUNCTION gbt_text_consistent(internal,text,int2,oid,internal);
 
 DROP OPERATOR CLASS gist_macaddr_ops USING gist;
 
@@ -95,7 +95,7 @@ DROP FUNCTION gbt_macad_penalty(internal,internal,internal);
 
 DROP FUNCTION gbt_macad_compress(internal);
 
-DROP FUNCTION gbt_macad_consistent(internal,macaddr,int2);
+DROP FUNCTION gbt_macad_consistent(internal,macaddr,int2,oid,internal);
 
 DROP OPERATOR CLASS gist_cash_ops USING gist;
 
@@ -109,7 +109,7 @@ DROP FUNCTION gbt_cash_penalty(internal,internal,internal);
 
 DROP FUNCTION gbt_cash_compress(internal);
 
-DROP FUNCTION gbt_cash_consistent(internal,money,int2);
+DROP FUNCTION gbt_cash_consistent(internal,money,int2,oid,internal);
 
 DROP OPERATOR CLASS gist_interval_ops USING gist;
 
@@ -125,7 +125,7 @@ DROP FUNCTION gbt_intv_decompress(internal);
 
 DROP FUNCTION gbt_intv_compress(internal);
 
-DROP FUNCTION gbt_intv_consistent(internal,interval,int2);
+DROP FUNCTION gbt_intv_consistent(internal,interval,int2,oid,internal);
 
 DROP OPERATOR CLASS gist_date_ops USING gist;
 
@@ -139,7 +139,7 @@ DROP FUNCTION gbt_date_penalty(internal,internal,internal);
 
 DROP FUNCTION gbt_date_compress(internal);
 
-DROP FUNCTION gbt_date_consistent(internal,date,int2);
+DROP FUNCTION gbt_date_consistent(internal,date,int2,oid,internal);
 
 DROP OPERATOR CLASS gist_timetz_ops USING gist;
 
@@ -157,9 +157,9 @@ DROP FUNCTION gbt_timetz_compress(internal);
 
 DROP FUNCTION gbt_time_compress(internal);
 
-DROP FUNCTION gbt_timetz_consistent(internal,timetz,int2);
+DROP FUNCTION gbt_timetz_consistent(internal,timetz,int2,oid,internal);
 
-DROP FUNCTION gbt_time_consistent(internal,time,int2);
+DROP FUNCTION gbt_time_consistent(internal,time,int2,oid,internal);
 
 DROP OPERATOR CLASS gist_timestamptz_ops USING gist;
 
@@ -177,9 +177,9 @@ DROP FUNCTION gbt_tstz_compress(internal);
 
 DROP FUNCTION gbt_ts_compress(internal);
       
-DROP FUNCTION gbt_tstz_consistent(internal,timestamptz,int2);
+DROP FUNCTION gbt_tstz_consistent(internal,timestamptz,int2,oid,internal);
 
-DROP FUNCTION gbt_ts_consistent(internal,timestamp,int2);
+DROP FUNCTION gbt_ts_consistent(internal,timestamp,int2,oid,internal);
 
 DROP OPERATOR CLASS gist_float8_ops USING gist;
 
@@ -193,7 +193,7 @@ DROP FUNCTION gbt_float8_penalty(internal,internal,internal);
 
 DROP FUNCTION gbt_float8_compress(internal);
 
-DROP FUNCTION gbt_float8_consistent(internal,float8,int2);
+DROP FUNCTION gbt_float8_consistent(internal,float8,int2,oid,internal);
 
 DROP OPERATOR CLASS gist_float4_ops USING gist;
 
@@ -207,7 +207,7 @@ DROP FUNCTION gbt_float4_penalty(internal,internal,internal);
 
 DROP FUNCTION gbt_float4_compress(internal);
 
-DROP FUNCTION gbt_float4_consistent(internal,float4,int2);
+DROP FUNCTION gbt_float4_consistent(internal,float4,int2,oid,internal);
 
 DROP OPERATOR CLASS gist_int8_ops USING gist;
 
@@ -221,7 +221,7 @@ DROP FUNCTION gbt_int8_penalty(internal,internal,internal);
 
 DROP FUNCTION gbt_int8_compress(internal);
 
-DROP FUNCTION gbt_int8_consistent(internal,int8,int2);
+DROP FUNCTION gbt_int8_consistent(internal,int8,int2,oid,internal);
 
 DROP OPERATOR CLASS gist_int4_ops USING gist;
 
@@ -235,7 +235,7 @@ DROP FUNCTION gbt_int4_penalty(internal,internal,internal);
 
 DROP FUNCTION gbt_int4_compress(internal);
 
-DROP FUNCTION gbt_int4_consistent(internal,int4,int2);
+DROP FUNCTION gbt_int4_consistent(internal,int4,int2,oid,internal);
 
 DROP OPERATOR CLASS gist_int2_ops USING gist;
 
@@ -249,7 +249,7 @@ DROP FUNCTION gbt_int2_penalty(internal,internal,internal);
 
 DROP FUNCTION gbt_int2_compress(internal);
 
-DROP FUNCTION gbt_int2_consistent(internal,int2,int2);
+DROP FUNCTION gbt_int2_consistent(internal,int2,int2,oid,internal);
 
 DROP OPERATOR CLASS gist_oid_ops USING gist;
 
@@ -267,7 +267,7 @@ DROP FUNCTION gbt_decompress(internal);
 
 DROP FUNCTION gbt_oid_compress(internal);
 
-DROP FUNCTION gbt_oid_consistent(internal,oid,int2);
+DROP FUNCTION gbt_oid_consistent(internal,oid,int2,oid,internal);
 
 DROP TYPE gbtreekey_var CASCADE;
 
index 402ca98eda7d612d50aded87020f0615beb148fc..9a8972625c943b7fede97967524db7da6a2984a2 100644 (file)
@@ -381,8 +381,13 @@ g_cube_consistent(PG_FUNCTION_ARGS)
        GISTENTRY  *entry = (GISTENTRY *) PG_GETARG_POINTER(0);
        NDBOX      *query = PG_GETARG_NDBOX(1);
        StrategyNumber strategy = (StrategyNumber) PG_GETARG_UINT16(2);
+       /* Oid          subtype = PG_GETARG_OID(3); */
+       bool       *recheck = (bool *) PG_GETARG_POINTER(4);
        bool            res;
 
+       /* All cases served by this function are exact */
+       *recheck = false;
+
        /*
         * if entry is not leaf, use g_cube_internal_consistent, else use
         * g_cube_leaf_consistent
index 09ddad46697e6b4287dd73461860f2374bf16d83..77cba19b070f30ae8635172a18c2d4104d806beb 100644 (file)
@@ -262,7 +262,7 @@ CREATE OPERATOR ~ (
 
 
 -- define the GiST support methods
-CREATE OR REPLACE FUNCTION g_cube_consistent(internal,cube,int4)
+CREATE OR REPLACE FUNCTION g_cube_consistent(internal,cube,int,oid,internal)
 RETURNS bool
 AS 'MODULE_PATHNAME'
 LANGUAGE C IMMUTABLE;
@@ -317,7 +317,7 @@ CREATE OPERATOR CLASS gist_cube_ops
        OPERATOR        8       <@ ,
        OPERATOR        13      @ ,
        OPERATOR        14      ~ ,
-       FUNCTION        1       g_cube_consistent (internal, cube, int4),
+       FUNCTION        1       g_cube_consistent (internal, cube, int, oid, internal),
        FUNCTION        2       g_cube_union (internal, internal),
        FUNCTION        3       g_cube_compress (internal),
        FUNCTION        4       g_cube_decompress (internal),
index a6f7573f45835f5455b85941719673d4168ac02c..ff54f08005ec1aa536160ef17252802615aec922 100644 (file)
@@ -19,7 +19,7 @@ DROP FUNCTION g_cube_decompress(internal);
 
 DROP FUNCTION g_cube_compress(internal);
 
-DROP FUNCTION g_cube_consistent(internal,cube,int4);
+DROP FUNCTION g_cube_consistent(internal,cube,int,oid,internal);
 
 DROP OPERATOR ~ (cube, cube);
 
index 9ce52f119dd7f33574949ea1ea798791836d3cc8..0ccc71cab363bbd26c9c7a04cb976d23ecec7515 100644 (file)
@@ -214,7 +214,7 @@ RETURNS internal
 AS 'MODULE_PATHNAME'
 LANGUAGE C IMMUTABLE;
 
-CREATE OR REPLACE FUNCTION ghstore_consistent(internal,internal,int4)
+CREATE OR REPLACE FUNCTION ghstore_consistent(internal,internal,int,oid,internal)
 RETURNS bool
 AS 'MODULE_PATHNAME'
 LANGUAGE C IMMUTABLE;
@@ -223,12 +223,12 @@ LANGUAGE C IMMUTABLE;
 CREATE OPERATOR CLASS gist_hstore_ops
 DEFAULT FOR TYPE hstore USING gist
 AS
-               OPERATOR        7       @>       RECHECK,
-               OPERATOR        9       ?(hstore,text)       RECHECK,
-        --OPERATOR        8       <@       RECHECK,
-        OPERATOR        13      @       RECHECK,
-        --OPERATOR        14      ~       RECHECK,
-        FUNCTION        1       ghstore_consistent (internal, internal, int4),
+               OPERATOR        7       @> ,
+               OPERATOR        9       ?(hstore,text) ,
+        --OPERATOR        8       <@ ,
+        OPERATOR        13      @ ,
+        --OPERATOR        14      ~ ,
+        FUNCTION        1       ghstore_consistent (internal, internal, int, oid, internal),
         FUNCTION        2       ghstore_union (internal, internal),
         FUNCTION        3       ghstore_compress (internal),
         FUNCTION        4       ghstore_decompress (internal),
@@ -249,18 +249,18 @@ RETURNS internal
 AS 'MODULE_PATHNAME'
 LANGUAGE C IMMUTABLE;
 
-CREATE OR REPLACE FUNCTION gin_consistent_hstore(internal, int2, internal)
-RETURNS internal
+CREATE OR REPLACE FUNCTION gin_consistent_hstore(internal, int2, internal, internal)
+RETURNS bool
 AS 'MODULE_PATHNAME'
 LANGUAGE C IMMUTABLE;
 
 CREATE OPERATOR CLASS gin_hstore_ops
 DEFAULT FOR TYPE hstore USING gin
 AS
-       OPERATOR        7       @> RECHECK,
+       OPERATOR        7       @> ,
        OPERATOR        9       ?(hstore,text),
        FUNCTION        1       bttextcmp(text,text),
        FUNCTION        2       gin_extract_hstore(internal, internal),
        FUNCTION        3       gin_extract_hstore_query(internal, internal, int2),
-       FUNCTION        4       gin_consistent_hstore(internal, int2, internal),
+       FUNCTION        4       gin_consistent_hstore(internal, int2, internal, internal),
 STORAGE         text;
index 144758f3cd5e60863872baa910dfe38e674a08fe..aec25b2b652a2ed59de1f1cd8e19eed5509fb379 100644 (file)
@@ -113,21 +113,31 @@ Datum             gin_consistent_hstore(PG_FUNCTION_ARGS);
 Datum
 gin_consistent_hstore(PG_FUNCTION_ARGS)
 {
+       bool       *check = (bool *) PG_GETARG_POINTER(0);
        StrategyNumber strategy = PG_GETARG_UINT16(1);
+       HStore     *query = PG_GETARG_HS(2);
+       bool       *recheck = (bool *) PG_GETARG_POINTER(3);
        bool            res = true;
 
        if (strategy == HStoreContainsStrategyNumber)
        {
-               bool       *check = (bool *) PG_GETARG_POINTER(0);
-               HStore     *query = PG_GETARG_HS(2);
                int                     i;
 
+               /*
+                * Index lost information about correspondence of keys
+                * and values, so we need recheck
+                */
+               *recheck = true;
                for (i = 0; res && i < 2 * query->size; i++)
                        if (check[i] == false)
                                res = false;
        }
        else if (strategy == HStoreExistsStrategyNumber)
+       {
+               /* Existence of key is guaranteed */
+               *recheck = false;
                res = true;
+       }
        else
                elog(ERROR, "Unsupported strategy number: %d", strategy);
 
index aa3aa0d94be25a72b03bc037e203d0c0d38cf2ec..15ac9659919a16a56001b2387225678cfc9656da 100644 (file)
@@ -508,9 +508,14 @@ ghstore_consistent(PG_FUNCTION_ARGS)
 {
        GISTTYPE   *entry = (GISTTYPE *) DatumGetPointer(((GISTENTRY *) PG_GETARG_POINTER(0))->key);
        StrategyNumber strategy = (StrategyNumber) PG_GETARG_UINT16(2);
+       /* Oid          subtype = PG_GETARG_OID(3); */
+       bool       *recheck = (bool *) PG_GETARG_POINTER(4);
        bool            res = true;
        BITVECP         sign;
 
+       /* All cases served by this function are inexact */
+       *recheck = true;
+
        if (ISALLTRUE(entry))
                PG_RETURN_BOOL(true);
 
index 78a83143376cca1e1922bfe52338fb95c7dd9ded..e776591fe2b56f42c4d99348f6cee82c150e8c5a 100644 (file)
@@ -37,8 +37,8 @@ DROP FUNCTION ghstore_penalty(internal,internal,internal);
 DROP FUNCTION ghstore_picksplit(internal, internal);
 DROP FUNCTION ghstore_union(internal, internal);
 DROP FUNCTION ghstore_same(internal, internal, internal);
-DROP FUNCTION ghstore_consistent(internal,internal,int4);
-DROP FUNCTION gin_consistent_hstore(internal, smallint, internal);
+DROP FUNCTION ghstore_consistent(internal,internal,int,oid,internal);
+DROP FUNCTION gin_consistent_hstore(internal, int2, internal, internal);
 DROP FUNCTION gin_extract_hstore(internal, internal);
 DROP FUNCTION gin_extract_hstore_query(internal, internal, smallint);
 
index 2ef8c6a534bbfa94151bb5721c66205c85001f13..a0747b3011f30c74fce8f70277231c7666eee329 100644 (file)
@@ -323,7 +323,7 @@ CREATE OPERATOR & (
 --------------
 
 -- define the GiST support methods
-CREATE OR REPLACE FUNCTION g_int_consistent(internal,_int4,int4)
+CREATE OR REPLACE FUNCTION g_int_consistent(internal,_int4,int,oid,internal)
 RETURNS bool
 AS 'MODULE_PATHNAME'
 LANGUAGE C IMMUTABLE;
@@ -364,13 +364,13 @@ LANGUAGE C IMMUTABLE;
 CREATE OPERATOR CLASS gist__int_ops
 DEFAULT FOR TYPE _int4 USING gist AS
        OPERATOR        3       &&,
-       OPERATOR        6       = (anyarray, anyarray)  RECHECK,
+       OPERATOR        6       = (anyarray, anyarray),
        OPERATOR        7       @>,
        OPERATOR        8       <@,
        OPERATOR        13      @,
        OPERATOR        14      ~,
        OPERATOR        20      @@ (_int4, query_int),
-       FUNCTION        1       g_int_consistent (internal, _int4, int4),
+       FUNCTION        1       g_int_consistent (internal, _int4, int, oid, internal),
        FUNCTION        2       g_int_union (internal, internal),
        FUNCTION        3       g_int_compress (internal),
        FUNCTION        4       g_int_decompress (internal),
@@ -400,7 +400,7 @@ CREATE TYPE intbig_gkey (
         OUTPUT = _intbig_out
 );
 
-CREATE OR REPLACE FUNCTION g_intbig_consistent(internal,internal,int4)
+CREATE OR REPLACE FUNCTION g_intbig_consistent(internal,internal,int,oid,internal)
 RETURNS bool
 AS 'MODULE_PATHNAME'
 LANGUAGE C IMMUTABLE;
@@ -440,14 +440,14 @@ LANGUAGE C IMMUTABLE;
 CREATE OPERATOR CLASS gist__intbig_ops
 FOR TYPE _int4 USING gist
 AS
-       OPERATOR        3       &&      RECHECK,
-       OPERATOR        6       = (anyarray, anyarray)  RECHECK,
-       OPERATOR        7       @>      RECHECK,
-       OPERATOR        8       <@      RECHECK,
-       OPERATOR        13      @       RECHECK,
-       OPERATOR        14      ~       RECHECK,
-       OPERATOR        20      @@ (_int4, query_int)   RECHECK,
-       FUNCTION        1       g_intbig_consistent (internal, internal, int4),
+       OPERATOR        3       &&,
+       OPERATOR        6       = (anyarray, anyarray),
+       OPERATOR        7       @>,
+       OPERATOR        8       <@,
+       OPERATOR        13      @,
+       OPERATOR        14      ~,
+       OPERATOR        20      @@ (_int4, query_int),
+       FUNCTION        1       g_intbig_consistent (internal, internal, int, oid, internal),
        FUNCTION        2       g_intbig_union (internal, internal),
        FUNCTION        3       g_intbig_compress (internal),
        FUNCTION        4       g_intbig_decompress (internal),
@@ -463,7 +463,7 @@ RETURNS internal
 AS 'MODULE_PATHNAME'
 LANGUAGE C IMMUTABLE;
 
-CREATE OR REPLACE FUNCTION ginint4_consistent(internal, int2, internal)
+CREATE OR REPLACE FUNCTION ginint4_consistent(internal, int2, internal, internal)
 RETURNS internal
 AS 'MODULE_PATHNAME'
 LANGUAGE C IMMUTABLE;
@@ -472,14 +472,14 @@ CREATE OPERATOR CLASS gin__int_ops
 FOR TYPE _int4 USING gin
 AS
        OPERATOR        3       &&,
-       OPERATOR        6       = (anyarray, anyarray)  RECHECK,
+       OPERATOR        6       = (anyarray, anyarray),
        OPERATOR        7       @>,
-       OPERATOR        8       <@      RECHECK,
+       OPERATOR        8       <@,
        OPERATOR        13      @,
-       OPERATOR        14      ~       RECHECK,
+       OPERATOR        14      ~,
        OPERATOR        20      @@ (_int4, query_int),
        FUNCTION        1       btint4cmp (int4, int4),
        FUNCTION        2       ginarrayextract (anyarray, internal),
        FUNCTION        3       ginint4_queryextract (internal, internal, int2),
-       FUNCTION        4       ginint4_consistent (internal, int2, internal),
+       FUNCTION        4       ginint4_consistent (internal, int2, internal, internal),
        STORAGE         int4;
index 6856a68e03835ba7af33be65f4069f3391210e09..8b6e99edae3b3cce332980ce40221febf9e0f0b9 100644 (file)
@@ -82,50 +82,76 @@ ginint4_consistent(PG_FUNCTION_ARGS)
 {
        bool       *check = (bool *) PG_GETARG_POINTER(0);
        StrategyNumber strategy = PG_GETARG_UINT16(1);
-       int                     res = FALSE;
+       bool       *recheck = (bool *) PG_GETARG_POINTER(3);
+       bool            res = FALSE;
 
        /*
-        * we can do not check array carefully, it's done by previous
+        * we need not check array carefully, it's done by previous
         * ginarrayextract call
         */
 
        switch (strategy)
        {
                case RTOverlapStrategyNumber:
+                       /* result is not lossy */
+                       *recheck = false;
+                       /* at least one element in check[] is true, so result = true */
+                       res = TRUE;
+                       break;
                case RTContainedByStrategyNumber:
                case RTOldContainedByStrategyNumber:
+                       /* we will need recheck */
+                       *recheck = true;
                        /* at least one element in check[] is true, so result = true */
-
                        res = TRUE;
                        break;
                case RTSameStrategyNumber:
+                       {
+                               ArrayType  *query = PG_GETARG_ARRAYTYPE_P(2);
+                               int                     i,
+                                                       nentries = ARRNELEMS(query);
+
+                               /* we will need recheck */
+                               *recheck = true;
+                               res = TRUE;
+                               for (i = 0; i < nentries; i++)
+                                       if (!check[i])
+                                       {
+                                               res = FALSE;
+                                               break;
+                                       }
+                       }
+                       break;
                case RTContainsStrategyNumber:
                case RTOldContainsStrategyNumber:
-                       res = TRUE;
-                       do
                        {
                                ArrayType  *query = PG_GETARG_ARRAYTYPE_P(2);
                                int                     i,
                                                        nentries = ARRNELEMS(query);
 
+                               /* result is not lossy */
+                               *recheck = false;
+                               res = TRUE;
                                for (i = 0; i < nentries; i++)
                                        if (!check[i])
                                        {
                                                res = FALSE;
                                                break;
                                        }
-                       } while (0);
+                       }
                        break;
                case BooleanSearchStrategy:
-                       do
                        {
                                QUERYTYPE  *query = (QUERYTYPE *) PG_DETOAST_DATUM(PG_GETARG_POINTER(2));
 
+                               /* result is not lossy */
+                               *recheck = false;
                                res = ginconsistent(query, check);
-                       } while (0);
+                       }
                        break;
                default:
-                       elog(ERROR, "ginint4_consistent: unknown strategy number: %d", strategy);
+                       elog(ERROR, "ginint4_consistent: unknown strategy number: %d",
+                                strategy);
        }
 
        PG_RETURN_BOOL(res);
index abd576223e83be6a824d3f37941789f486a7129b..37c05784b96700ab5f4da2d677b1130f6ee1a62b 100644 (file)
@@ -34,8 +34,13 @@ g_int_consistent(PG_FUNCTION_ARGS)
        GISTENTRY  *entry = (GISTENTRY *) PG_GETARG_POINTER(0);
        ArrayType  *query = (ArrayType *) PG_DETOAST_DATUM_COPY(PG_GETARG_POINTER(1));
        StrategyNumber strategy = (StrategyNumber) PG_GETARG_UINT16(2);
+       /* Oid          subtype = PG_GETARG_OID(3); */
+       bool       *recheck = (bool *) PG_GETARG_POINTER(4);
        bool            retval;
 
+       /* this is exact except for RTSameStrategyNumber */
+       *recheck = (strategy == RTSameStrategyNumber);
+
        if (strategy == BooleanSearchStrategy)
        {
                retval = execconsistent((QUERYTYPE *) query,
index 3bfbc84dc7520f00496d9eb9ed28e730451c0735..b96c6d728937b153770bef0508790d78dea9b200 100644 (file)
@@ -498,8 +498,13 @@ g_intbig_consistent(PG_FUNCTION_ARGS)
        GISTENTRY  *entry = (GISTENTRY *) PG_GETARG_POINTER(0);
        ArrayType  *query = (ArrayType *) PG_DETOAST_DATUM(PG_GETARG_POINTER(1));
        StrategyNumber strategy = (StrategyNumber) PG_GETARG_UINT16(2);
+       /* Oid          subtype = PG_GETARG_OID(3); */
+       bool       *recheck = (bool *) PG_GETARG_POINTER(4);
        bool            retval;
 
+       /* All cases served by this function are inexact */
+       *recheck = true;
+
        if (ISALLTRUE(DatumGetPointer(entry->key)))
                PG_RETURN_BOOL(true);
 
index 84a1389bcf4dda5d4d7809854248b5b0fd63bf87..8729e07364ee1982d6c31865eb142e9233f1d6f2 100644 (file)
@@ -7,7 +7,7 @@ DROP OPERATOR CLASS gin__int_ops USING gin;
 
 DROP FUNCTION ginint4_queryextract(internal, internal, int2);
 
-DROP FUNCTION ginint4_consistent(internal, int2, internal);
+DROP FUNCTION ginint4_consistent(internal, int2, internal, internal);
 
 DROP OPERATOR CLASS gist__intbig_ops USING gist;
 
@@ -23,7 +23,7 @@ DROP FUNCTION g_intbig_decompress(internal);
 
 DROP FUNCTION g_intbig_compress(internal);
 
-DROP FUNCTION g_intbig_consistent(internal,internal,int4);
+DROP FUNCTION g_intbig_consistent(internal,internal,int,oid,internal);
 
 DROP TYPE intbig_gkey CASCADE;
 
@@ -41,7 +41,7 @@ DROP FUNCTION g_int_decompress(internal);
 
 DROP FUNCTION g_int_compress(internal);
 
-DROP FUNCTION g_int_consistent(internal,_int4,int4);
+DROP FUNCTION g_int_consistent(internal,_int4,int,oid,internal);
 
 DROP OPERATOR & (_int4, _int4);
 
index 34ec2552ca4b90367b9462d310a621cca2d4db5b..1c9b6b03eaa4d1e5c599ac5418c7ea361f835e1f 100644 (file)
@@ -554,10 +554,15 @@ _ltree_consistent(PG_FUNCTION_ARGS)
 {
        GISTENTRY  *entry = (GISTENTRY *) PG_GETARG_POINTER(0);
        char       *query = (char *) DatumGetPointer(PG_DETOAST_DATUM(PG_GETARG_DATUM(1)));
-       ltree_gist *key = (ltree_gist *) DatumGetPointer(entry->key);
        StrategyNumber strategy = (StrategyNumber) PG_GETARG_UINT16(2);
+       /* Oid          subtype = PG_GETARG_OID(3); */
+       bool       *recheck = (bool *) PG_GETARG_POINTER(4);
+       ltree_gist *key = (ltree_gist *) DatumGetPointer(entry->key);
        bool            res = false;
 
+       /* All cases served by this function are inexact */
+       *recheck = true;
+
        switch (strategy)
        {
                case 10:
index f6c9a03b206960d3db1932be6a9497ee405d08e5..2966b24cd5499bd3662af242d775ff9c1b5a17ab 100644 (file)
@@ -496,7 +496,7 @@ CREATE TYPE ltree_gist (
 );   
 
 
-CREATE OR REPLACE FUNCTION ltree_consistent(internal,internal,int2)
+CREATE OR REPLACE FUNCTION ltree_consistent(internal,internal,int2,oid,internal)
 RETURNS bool as 'MODULE_PATHNAME' LANGUAGE C IMMUTABLE;
 
 CREATE OR REPLACE FUNCTION ltree_compress(internal)
@@ -532,7 +532,7 @@ CREATE OPERATOR CLASS gist_ltree_ops
        OPERATOR        15      @ (ltxtquery, ltree) ,
        OPERATOR        16      ? (ltree, _lquery) ,
        OPERATOR        17      ? (_lquery, ltree) ,
-       FUNCTION        1       ltree_consistent (internal, internal, int2),
+       FUNCTION        1       ltree_consistent (internal, internal, int2, oid, internal),
        FUNCTION        2       ltree_union (internal, internal),
        FUNCTION        3       ltree_compress (internal),
        FUNCTION        4       ltree_decompress (internal),
@@ -822,7 +822,7 @@ CREATE OPERATOR ?@ (
 );
 
 --GiST support for ltree[]
-CREATE OR REPLACE FUNCTION _ltree_consistent(internal,internal,int2)
+CREATE OR REPLACE FUNCTION _ltree_consistent(internal,internal,int2,oid,internal)
 RETURNS bool
 AS 'MODULE_PATHNAME'
 LANGUAGE C IMMUTABLE;
@@ -854,15 +854,15 @@ LANGUAGE C IMMUTABLE;
 
 CREATE OPERATOR CLASS gist__ltree_ops
     DEFAULT FOR TYPE _ltree USING gist AS
-       OPERATOR        10      <@ (_ltree, ltree)      RECHECK ,
-       OPERATOR        11      @> (ltree, _ltree)      RECHECK ,
-       OPERATOR        12      ~ (_ltree, lquery)      RECHECK ,
-       OPERATOR        13      ~ (lquery, _ltree)      RECHECK ,
-       OPERATOR        14      @ (_ltree, ltxtquery)   RECHECK ,
-       OPERATOR        15      @ (ltxtquery, _ltree)   RECHECK ,
-       OPERATOR        16      ? (_ltree, _lquery)     RECHECK ,
-       OPERATOR        17      ? (_lquery, _ltree)     RECHECK ,
-       FUNCTION        1       _ltree_consistent (internal, internal, int2),
+       OPERATOR        10      <@ (_ltree, ltree),
+       OPERATOR        11      @> (ltree, _ltree),
+       OPERATOR        12      ~ (_ltree, lquery),
+       OPERATOR        13      ~ (lquery, _ltree),
+       OPERATOR        14      @ (_ltree, ltxtquery),
+       OPERATOR        15      @ (ltxtquery, _ltree),
+       OPERATOR        16      ? (_ltree, _lquery),
+       OPERATOR        17      ? (_lquery, _ltree),
+       FUNCTION        1       _ltree_consistent (internal, internal, int2, oid, internal),
        FUNCTION        2       _ltree_union (internal, internal),
        FUNCTION        3       _ltree_compress (internal),
        FUNCTION        4       ltree_decompress (internal),
index e985cf5febb3551fabe926b24d8f05eb47495cff..72ce30818fb6f55ee47327839474ee836f916389 100644 (file)
@@ -624,11 +624,16 @@ Datum
 ltree_consistent(PG_FUNCTION_ARGS)
 {
        GISTENTRY  *entry = (GISTENTRY *) PG_GETARG_POINTER(0);
-       void       *query = NULL;
-       ltree_gist *key = (ltree_gist *) DatumGetPointer(entry->key);
        StrategyNumber strategy = (StrategyNumber) PG_GETARG_UINT16(2);
+       /* Oid          subtype = PG_GETARG_OID(3); */
+       bool       *recheck = (bool *) PG_GETARG_POINTER(4);
+       ltree_gist *key = (ltree_gist *) DatumGetPointer(entry->key);
+       void       *query = NULL;
        bool            res = false;
 
+       /* All cases served by this function are exact */
+       *recheck = false;
+
        switch (strategy)
        {
                case BTLessStrategyNumber:
index 8f80f3d7d1e313960acb626191921772244e870a..7355f0580344d4a14432c4d9ef73e75586ac8cd4 100644 (file)
@@ -15,7 +15,7 @@ DROP FUNCTION _ltree_penalty(internal,internal,internal);
 
 DROP FUNCTION _ltree_compress(internal);
 
-DROP FUNCTION _ltree_consistent(internal,internal,int2);
+DROP FUNCTION _ltree_consistent(internal,internal,int2,oid,internal);
 
 DROP OPERATOR ?@ (_ltree, ltxtquery);
 
@@ -107,7 +107,7 @@ DROP FUNCTION ltree_decompress(internal);
 
 DROP FUNCTION ltree_compress(internal);
 
-DROP FUNCTION ltree_consistent(internal,internal,int2);
+DROP FUNCTION ltree_consistent(internal,internal,int2,oid,internal);
 
 DROP TYPE ltree_gist CASCADE;
   
index 962e37effe9a78fcf90152c2c714f3f385e7d7d4..542a27dea5ec9394264d0948c41db7bd57b218ac 100644 (file)
@@ -55,7 +55,7 @@ CREATE TYPE gtrgm (
 );
 
 -- support functions for gist
-CREATE OR REPLACE FUNCTION gtrgm_consistent(gtrgm,internal,int4)
+CREATE OR REPLACE FUNCTION gtrgm_consistent(internal,text,int,oid,internal)
 RETURNS bool
 AS 'MODULE_PATHNAME'
 LANGUAGE C IMMUTABLE;
@@ -95,7 +95,7 @@ CREATE OPERATOR CLASS gist_trgm_ops
 FOR TYPE text USING gist
 AS
         OPERATOR        1       % (text, text),
-        FUNCTION        1       gtrgm_consistent (gtrgm, internal, int4),
+        FUNCTION        1       gtrgm_consistent (internal, text, int, oid, internal),
         FUNCTION        2       gtrgm_union (bytea, internal),
         FUNCTION        3       gtrgm_compress (internal),
         FUNCTION        4       gtrgm_decompress (internal),
@@ -115,7 +115,7 @@ RETURNS internal
 AS 'MODULE_PATHNAME'
 LANGUAGE C IMMUTABLE;
 
-CREATE OR REPLACE FUNCTION gin_trgm_consistent(internal, internal, text)
+CREATE OR REPLACE FUNCTION gin_trgm_consistent(internal, int2, text, internal)
 RETURNS internal
 AS 'MODULE_PATHNAME'
 LANGUAGE C IMMUTABLE;
@@ -124,9 +124,9 @@ LANGUAGE C IMMUTABLE;
 CREATE OPERATOR CLASS gin_trgm_ops
 FOR TYPE text USING gin
 AS
-        OPERATOR        1       % (text, text) RECHECK,
+        OPERATOR        1       % (text, text),
         FUNCTION        1       btint4cmp (int4, int4),
         FUNCTION        2       gin_extract_trgm (text, internal),
         FUNCTION        3       gin_extract_trgm (text, internal, internal),
-        FUNCTION        4       gin_trgm_consistent (internal, internal, text),
+        FUNCTION        4       gin_trgm_consistent (internal, int2, text, internal),
         STORAGE         int4;
index 33d005ae9a0aabbfa71c07b0729dc643d2d1dfc6..9a36afa074a2bc3862fb523b099a6b628e0fb4bf 100644 (file)
@@ -53,13 +53,18 @@ Datum
 gin_trgm_consistent(PG_FUNCTION_ARGS)
 {
        bool       *check = (bool *) PG_GETARG_POINTER(0);
-       text       *query = (text *) PG_GETARG_TEXT_P(2);
+       /* StrategyNumber strategy = PG_GETARG_UINT16(1); */
+       text       *query = PG_GETARG_TEXT_P(2);
+       bool       *recheck = (bool *) PG_GETARG_POINTER(3);
        bool            res = FALSE;
        TRGM       *trg;
        int4            i,
                                trglen,
                                ntrue = 0;
 
+       /* All cases served by this function are inexact */
+       *recheck = true;
+
        trg = generate_trgm(VARDATA(query), VARSIZE(query) - VARHDRSZ);
        trglen = ARRNELEM(trg);
 
index 4286928d3483fdf0df6bb470fb98377f465a825d..9cf88dc45bd902ecccab50871a9dba1a284fda89 100644 (file)
@@ -159,12 +159,19 @@ gtrgm_decompress(PG_FUNCTION_ARGS)
 Datum
 gtrgm_consistent(PG_FUNCTION_ARGS)
 {
-       text       *query = (text *) PG_GETARG_TEXT_P(1);
-       TRGM       *key = (TRGM *) DatumGetPointer(((GISTENTRY *) PG_GETARG_POINTER(0))->key);
+       GISTENTRY  *entry = (GISTENTRY *) PG_GETARG_POINTER(0);
+       text       *query = PG_GETARG_TEXT_P(1);
+       /* StrategyNumber strategy = (StrategyNumber) PG_GETARG_UINT16(2); */
+       /* Oid          subtype = PG_GETARG_OID(3); */
+       bool       *recheck = (bool *) PG_GETARG_POINTER(4);
+       TRGM       *key = (TRGM *) DatumGetPointer(entry->key);
        TRGM       *qtrg = generate_trgm(VARDATA(query), VARSIZE(query) - VARHDRSZ);
-       int                     res = false;
+       bool            res = false;
+
+       /* All cases served by this function are exact */
+       *recheck = false;
 
-       if (GIST_LEAF((GISTENTRY *) PG_GETARG_POINTER(0)))
+       if (GIST_LEAF(entry))
        {                                                       /* all leafs contains orig trgm */
                float4          tmpsml = cnt_sml(key, qtrg);
 
index 24bb8b60f5ab04551ec3585b43280af3ad443b45..2dd343c299a4f72fcc50db349db48ee7ec6ccd77 100644 (file)
@@ -17,7 +17,7 @@ DROP FUNCTION gtrgm_decompress(internal);
 
 DROP FUNCTION gtrgm_compress(internal);
  
-DROP FUNCTION gtrgm_consistent(gtrgm,internal,int4);
+DROP FUNCTION gtrgm_consistent(internal,text,int,oid,internal);
 
 DROP TYPE gtrgm CASCADE;
 
@@ -27,7 +27,7 @@ DROP FUNCTION gin_extract_trgm(text, internal);
 
 DROP FUNCTION gin_extract_trgm(text, internal, internal);
 
-DROP FUNCTION gin_trgm_consistent(internal, internal, text);
+DROP FUNCTION gin_trgm_consistent(internal, int2, text, internal);
 
 DROP OPERATOR % (text, text);
 
index aea86765568685b73e9d43e0548aa4075552801d..65ddda1671f9b0bfc517f5f98c527dca24112a48 100644 (file)
@@ -42,7 +42,11 @@ float32              seg_center(SEG * seg);
 /*
 ** GiST support methods
 */
-bool           gseg_consistent(GISTENTRY *entry, SEG * query, StrategyNumber strategy);
+bool           gseg_consistent(GISTENTRY *entry,
+                                                       SEG * query,
+                                                       StrategyNumber strategy,
+                                                       Oid subtype,
+                                                       bool *recheck);
 GISTENTRY  *gseg_compress(GISTENTRY *entry);
 GISTENTRY  *gseg_decompress(GISTENTRY *entry);
 float     *gseg_penalty(GISTENTRY *origentry, GISTENTRY *newentry, float *result);
@@ -202,8 +206,13 @@ seg_upper(SEG * seg)
 bool
 gseg_consistent(GISTENTRY *entry,
                                SEG * query,
-                               StrategyNumber strategy)
+                               StrategyNumber strategy,
+                               Oid subtype,
+                               bool *recheck)
 {
+       /* All cases served by this function are exact */
+       *recheck = false;
+
        /*
         * if entry is not leaf, use gseg_internal_consistent, else use
         * gseg_leaf_consistent
index 9e03bc426ea66a1ecf3b442b3335686c6d94fdc3..ef74491996c9351e1963a74b033f97ff9dba33fb 100644 (file)
@@ -322,7 +322,7 @@ CREATE OPERATOR ~ (
 
 
 -- define the GiST support methods
-CREATE OR REPLACE FUNCTION gseg_consistent(internal,seg,int4)
+CREATE OR REPLACE FUNCTION gseg_consistent(internal,seg,int,oid,internal)
 RETURNS bool
 AS 'MODULE_PATHNAME'
 LANGUAGE C IMMUTABLE;
@@ -382,7 +382,7 @@ AS
        OPERATOR        8       <@ ,
        OPERATOR        13      @ ,
        OPERATOR        14      ~ ,
-       FUNCTION        1       gseg_consistent (internal, seg, int4),
+       FUNCTION        1       gseg_consistent (internal, seg, int, oid, internal),
        FUNCTION        2       gseg_union (internal, internal),
        FUNCTION        3       gseg_compress (internal),
        FUNCTION        4       gseg_decompress (internal),
index 161300943ac4fcee1eb3865781345cbc1cb04be4..606524ea38b2e71454f0b32f1fc709f83eff1d68 100644 (file)
@@ -19,7 +19,7 @@ DROP FUNCTION gseg_decompress(internal);
 
 DROP FUNCTION gseg_compress(internal);
 
-DROP FUNCTION gseg_consistent(internal,seg,int4);
+DROP FUNCTION gseg_consistent(internal,seg,int,oid,internal);
 
 DROP OPERATOR <@ (seg, seg);
 
index e8bac906688df5eaa5c36a00de5ad48c55ab0497..1e96002bdd984b762a3bc00bbb2c42f3b23e3fce 100644 (file)
@@ -388,8 +388,8 @@ CREATE FUNCTION headline(text, tsquery)
 CREATE OPERATOR CLASS gist_tsvector_ops
 FOR TYPE tsvector USING gist
 AS
-        OPERATOR        1       @@ (tsvector, tsquery)  RECHECK ,
-        FUNCTION        1       gtsvector_consistent (gtsvector, internal, int4),
+        OPERATOR        1       @@ (tsvector, tsquery),
+        FUNCTION        1       gtsvector_consistent (internal, gtsvector, int, oid, internal),
         FUNCTION        2       gtsvector_union (internal, internal),
         FUNCTION        3       gtsvector_compress (internal),
         FUNCTION        4       gtsvector_decompress (internal),
@@ -534,9 +534,9 @@ CREATE OR REPLACE FUNCTION tsq_mcontained(tsquery, tsquery)
 CREATE OPERATOR CLASS gist_tp_tsquery_ops
 FOR TYPE tsquery USING gist
 AS
-        OPERATOR        7       @> (tsquery, tsquery) RECHECK,
-        OPERATOR        8       <@ (tsquery, tsquery) RECHECK,
-        FUNCTION        1       gtsquery_consistent (bigint, internal, int4),
+        OPERATOR        7       @> (tsquery, tsquery),
+        OPERATOR        8       <@ (tsquery, tsquery),
+        FUNCTION        1       gtsquery_consistent (internal, internal, int, oid, internal),
         FUNCTION        2       gtsquery_union (internal, internal),
         FUNCTION        3       gtsquery_compress (internal),
         FUNCTION        4       gtsquery_decompress (internal),
@@ -549,11 +549,11 @@ CREATE OPERATOR CLASS gin_tsvector_ops
 FOR TYPE tsvector USING gin
 AS
         OPERATOR        1       @@ (tsvector, tsquery),
-        OPERATOR        2       @@@ (tsvector, tsquery) RECHECK,
+        OPERATOR        2       @@@ (tsvector, tsquery),
         FUNCTION        1       bttextcmp(text, text),
         FUNCTION        2       gin_extract_tsvector(tsvector,internal),
         FUNCTION        3       gin_extract_tsquery(tsquery,internal,smallint),
-        FUNCTION        4       gin_tsquery_consistent(internal,smallint,tsquery),
+        FUNCTION        4       gin_tsquery_consistent(internal,smallint,tsquery,internal),
         STORAGE         text;
 
 CREATE OPERATOR CLASS tsvector_ops
index 5fbb2c61855e100e614d253ccde69e56cc19d23d..a15ac6c71e289dd44df620ae9e8c2d09722dbe38 100644 (file)
       <entry>Operator strategy number</entry>
      </row>
 
-     <row>
-      <entry><structfield>amopreqcheck</structfield></entry>
-      <entry><type>bool</type></entry>
-      <entry></entry>
-      <entry>Index hit must be rechecked</entry>
-     </row>
-
      <row>
       <entry><structfield>amopopr</structfield></entry>
       <entry><type>oid</type></entry>
index 7fcbb059abd7a3ac7eb5c5b03200902be790ea86..b1edec5e36d3370eb8fd0e3ec768bdd299d88f0d 100644 (file)
@@ -7738,7 +7738,7 @@ CREATE TYPE rainbow AS ENUM ('red', 'orange', 'yellow', 'green', 'blue', 'purple
        </row>
        <row>
         <entry> <literal>@@@</literal> </entry>
-        <entry>same as <literal>@@</>, but see <xref linkend="textsearch-indexes"></entry>
+        <entry>deprecated synonym for <literal>@@</></entry>
         <entry><literal>to_tsvector('fat cats ate rats') @@@ to_tsquery('cat &amp; rat')</literal></entry>
         <entry><literal>t</literal></entry>
        </row>
index e0a9cb2c98a8f263f3079189223daff332344703..a6614056c542fc1b682ef38321fcf128ccb1624f 100644 (file)
     </varlistentry>
 
     <varlistentry>
-     <term>bool consistent(bool check[], StrategyNumber n, Datum query)</term>
+     <term>bool consistent(bool check[], StrategyNumber n, Datum query, bool *recheck)</term>
      <listitem>
       <para>
        Returns TRUE if the indexed value satisfies the query operator with
-       strategy number <literal>n</> (or would satisfy, if the operator is
-       marked RECHECK in the operator class).  The <literal>check</> array has
+       strategy number <literal>n</> (or might satisfy, if the recheck
+       indication is returned).  The <literal>check</> array has
        the same length as the number of keys previously returned by
        <function>extractQuery</> for this query.  Each element of the
        <literal>check</> array is TRUE if the indexed value contains the
        <function>extractQuery</> result array is present in the indexed value.
        The original <literal>query</> datum (not the extracted key array!) is
        passed in case the <function>consistent</> method needs to consult it.
+       On success, <literal>*recheck</> should be set to TRUE if the heap
+       tuple needs to be rechecked against the query operator, or FALSE if
+       the index test is exact.
       </para>
      </listitem>
     </varlistentry>
index 387e8b8540ac8607241ff09788a520c96ce1bce8..d577523be14264c004dee4193c482b0fc4b3a04b 100644 (file)
        Given a predicate <literal>p</literal> on a tree page, and a user
        query, <literal>q</literal>, this method will return false if it is
        certain that both <literal>p</literal> and <literal>q</literal> cannot
-       be true for a given data item.
+       be true for a given data item.  For a true result, a
+       <literal>recheck</> flag must also be returned; this indicates whether
+       the predicate implies the query (<literal>recheck</> = false) or
+       not (<literal>recheck</> = true).
       </para>
      </listitem>
     </varlistentry>
index 37ebd12567fe8ef071c1b425dec8ee412b809052..bf3eb2978584d37685154aa5f74d78af87d6fc20 100644 (file)
@@ -183,7 +183,7 @@ aminsert (Relation indexRelation,
    parameter.  See <xref linkend="index-unique-checks"> for details.
    The result is TRUE if an index entry was inserted, FALSE if not. (A FALSE
    result does not denote an error condition, but is used for cases such
-   as an index AM refusing to index a NULL.)
+   as an index method refusing to index a NULL.)
   </para>
 
   <para>
@@ -430,13 +430,13 @@ amrestrpos (IndexScanDesc scan);
   </para>
 
   <para>
-   The operator family can indicate that the index is <firstterm>lossy</> for a
-   particular operator; this implies that the index scan will return all the
-   entries that pass the scan key, plus possibly additional entries that do
-   not.  The core system's index-scan machinery will then apply that operator
-   again to the heap tuple to verify whether or not it really should be
-   selected.  For non-lossy operators, the index scan must return exactly the
-   set of matching entries, as there is no recheck.
+   The access method can report that the index is <firstterm>lossy</>, or
+   requires rechecks, for a particular query.  This implies that the index
+   scan will return all the entries that pass the scan key, plus possibly
+   additional entries that do not.  The core system's index-scan machinery
+   will then apply the index conditions again to the heap tuple to verify
+   whether or not it really should be selected.  If the recheck option is not
+   specified, the index scan must return exactly the set of matching entries.
   </para>
 
   <para>
@@ -849,7 +849,7 @@ amcostestimate (PlannerInfo *root,
   <para>
    The indexSelectivity should be set to the estimated fraction of the parent
    table rows that will be retrieved during the index scan.  In the case
-   of a lossy index, this will typically be higher than the fraction of
+   of a lossy query, this will typically be higher than the fraction of
    rows that actually pass the given qual conditions.
   </para>
 
index bdb56aa5f6ed048c4303f54901266f0922fd0da6..59224a95325750f4afc6d873769233716b190323 100644 (file)
@@ -21,7 +21,7 @@ PostgreSQL documentation
  <refsynopsisdiv>
 <synopsis>
 ALTER OPERATOR FAMILY <replaceable>name</replaceable> USING <replaceable class="parameter">index_method</replaceable> ADD
-  {  OPERATOR <replaceable class="parameter">strategy_number</replaceable> <replaceable class="parameter">operator_name</replaceable> ( <replaceable class="parameter">op_type</replaceable>, <replaceable class="parameter">op_type</replaceable> ) [ RECHECK ]
+  {  OPERATOR <replaceable class="parameter">strategy_number</replaceable> <replaceable class="parameter">operator_name</replaceable> ( <replaceable class="parameter">op_type</replaceable>, <replaceable class="parameter">op_type</replaceable> )
    | FUNCTION <replaceable class="parameter">support_number</replaceable> [ ( <replaceable class="parameter">op_type</replaceable> [ , <replaceable class="parameter">op_type</replaceable> ] ) ] <replaceable class="parameter">funcname</replaceable> ( <replaceable class="parameter">argument_type</replaceable> [, ...] )
   } [, ... ]
 ALTER OPERATOR FAMILY <replaceable>name</replaceable> USING <replaceable class="parameter">index_method</replaceable> DROP
@@ -154,18 +154,6 @@ ALTER OPERATOR FAMILY <replaceable>name</replaceable> USING <replaceable class="
     </listitem>
    </varlistentry>
 
-   <varlistentry>
-    <term><literal>RECHECK</></term>
-    <listitem>
-     <para>
-      If present, the index is <quote>lossy</> for this operator, and
-      so the rows retrieved using the index must be rechecked to
-      verify that they actually satisfy the qualification clause
-      involving this operator.
-     </para>
-    </listitem>
-   </varlistentry>
-
    <varlistentry>
     <term><replaceable class="parameter">support_number</replaceable></term>
     <listitem>
@@ -247,6 +235,14 @@ ALTER OPERATOR FAMILY <replaceable>name</replaceable> USING <replaceable class="
    is likely to be inlined into the calling query, which will prevent
    the optimizer from recognizing that the query matches an index.
   </para>
+
+  <para>
+   Before <productname>PostgreSQL</productname> 8.4, the <literal>OPERATOR</>
+   clause could include a <literal>RECHECK</> option.  This is no longer
+   supported because whether an index operator is <quote>lossy</> is now
+   determined on-the-fly at runtime.  This allows efficient handling of
+   cases where an operator might or might not be lossy.
+  </para>
  </refsect1>
   
  <refsect1>
index e8eb9b2426c7f0ccf382e747c230d33940c8b0bf..244125dd167e95af0b2e99b6db4f9c7790cb5589 100644 (file)
@@ -22,7 +22,7 @@ PostgreSQL documentation
 <synopsis>
 CREATE OPERATOR CLASS <replaceable class="parameter">name</replaceable> [ DEFAULT ] FOR TYPE <replaceable class="parameter">data_type</replaceable>
   USING <replaceable class="parameter">index_method</replaceable> [ FAMILY <replaceable class="parameter">family_name</replaceable> ] AS
-  {  OPERATOR <replaceable class="parameter">strategy_number</replaceable> <replaceable class="parameter">operator_name</replaceable> [ ( <replaceable class="parameter">op_type</replaceable>, <replaceable class="parameter">op_type</replaceable> ) ] [ RECHECK ]
+  {  OPERATOR <replaceable class="parameter">strategy_number</replaceable> <replaceable class="parameter">operator_name</replaceable> [ ( <replaceable class="parameter">op_type</replaceable>, <replaceable class="parameter">op_type</replaceable> ) ]
    | FUNCTION <replaceable class="parameter">support_number</replaceable> [ ( <replaceable class="parameter">op_type</replaceable> [ , <replaceable class="parameter">op_type</replaceable> ] ) ] <replaceable class="parameter">funcname</replaceable> ( <replaceable class="parameter">argument_type</replaceable> [, ...] )
    | STORAGE <replaceable class="parameter">storage_type</replaceable>
   } [, ... ]
@@ -179,18 +179,6 @@ CREATE OPERATOR CLASS <replaceable class="parameter">name</replaceable> [ DEFAUL
     </listitem>
    </varlistentry>
 
-   <varlistentry>
-    <term><literal>RECHECK</></term>
-    <listitem>
-     <para>
-      If present, the index is <quote>lossy</> for this operator, and
-      so the rows retrieved using the index must be rechecked to
-      verify that they actually satisfy the qualification clause
-      involving this operator.
-     </para>
-    </listitem>
-   </varlistentry>
-
    <varlistentry>
     <term><replaceable class="parameter">support_number</replaceable></term>
     <listitem>
@@ -256,6 +244,14 @@ CREATE OPERATOR CLASS <replaceable class="parameter">name</replaceable> [ DEFAUL
    is likely to be inlined into the calling query, which will prevent
    the optimizer from recognizing that the query matches an index.
   </para>
+
+  <para>
+   Before <productname>PostgreSQL</productname> 8.4, the <literal>OPERATOR</>
+   clause could include a <literal>RECHECK</> option.  This is no longer
+   supported because whether an index operator is <quote>lossy</> is now
+   determined on-the-fly at runtime.  This allows efficient handling of
+   cases where an operator might or might not be lossy.
+  </para>
  </refsect1>
   
  <refsect1>
@@ -271,12 +267,12 @@ CREATE OPERATOR CLASS <replaceable class="parameter">name</replaceable> [ DEFAUL
 CREATE OPERATOR CLASS gist__int_ops
     DEFAULT FOR TYPE _int4 USING gist AS
         OPERATOR        3       &amp;&amp;,
-        OPERATOR        6       =       RECHECK,
+        OPERATOR        6       = (anyarray, anyarray),
         OPERATOR        7       @&gt;,
         OPERATOR        8       &lt;@,
         OPERATOR        20      @@ (_int4, query_int),
-        FUNCTION        1       g_int_consistent (internal, _int4, int4),
-        FUNCTION        2       g_int_union (bytea, internal),
+        FUNCTION        1       g_int_consistent (internal, _int4, int, oid, internal),
+        FUNCTION        2       g_int_union (internal, internal),
         FUNCTION        3       g_int_compress (internal),
         FUNCTION        4       g_int_decompress (internal),
         FUNCTION        5       g_int_penalty (internal, internal, internal),
index 031de8363db44c24dcf1ef4ae2c5ddf7da9261e5..4c0fe4a7bce95f11c0e1e26be34ffdd8f35e709b 100644 (file)
@@ -3142,19 +3142,7 @@ SELECT plainto_tsquery('supernovae stars');
    A GiST index is <firstterm>lossy</firstterm>, meaning that the index
    may produce false matches, and it is necessary
    to check the actual table row to eliminate such false matches.
-   <productname>PostgreSQL</productname> does this automatically; for
-   example, in the query plan below, the <literal>Filter:</literal>
-   line indicates the index output will be rechecked:
-
-<programlisting>
-EXPLAIN SELECT * FROM apod WHERE textsearch @@ to_tsquery('supernovae');
-                               QUERY PLAN
--------------------------------------------------------------------------
- Index Scan using textsearch_gidx on apod  (cost=0.00..12.29 rows=2 width=1469)
-   Index Cond: (textsearch @@ '''supernova'''::tsquery)
-   Filter: (textsearch @@ '''supernova'''::tsquery)
-</programlisting>
-
+   (<productname>PostgreSQL</productname> does this automatically when needed.)
    GiST indexes are lossy because each document is represented in the
    index by a fixed-length signature. The signature is generated by hashing
    each word into a random bit in an n-bit string, with all these bits OR-ed
@@ -3174,57 +3162,11 @@ EXPLAIN SELECT * FROM apod WHERE textsearch @@ to_tsquery('supernovae');
   </para>
 
   <para>
-   GIN indexes are not lossy but their performance depends logarithmically on
-   the number of unique words.
-  </para>
-
-  <para>
-   Actually, GIN indexes store only the words (lexemes) of <type>tsvector</>
-   values, and not their weight labels.  Thus, while a GIN index can be
-   considered non-lossy for a query that does not specify weights, it is
-   lossy for one that does.  Thus a table row recheck is needed when using
-   a query that involves weights.  Unfortunately, in the current design of
-   <productname>PostgreSQL</>, whether a recheck is needed is a static
-   property of a particular operator, and not something that can be enabled
-   or disabled on-the-fly depending on the values given to the operator.
-   To deal with this situation without imposing the overhead of rechecks
-   on queries that do not need them, the following approach has been
-   adopted:
-  </para>
-
-  <itemizedlist  spacing="compact" mark="bullet">
-   <listitem>
-    <para>
-     The standard text match operator <literal>@@</> is marked as non-lossy
-     for GIN indexes.
-    </para>
-   </listitem>
-
-   <listitem>
-    <para>
-     An additional match operator <literal>@@@</> is provided, and marked
-     as lossy for GIN indexes.  This operator behaves exactly like
-     <literal>@@</> otherwise.
-    </para>
-   </listitem>
-
-   <listitem>
-    <para>
-     When a GIN index search is initiated with the <literal>@@</> operator,
-     the index support code will throw an error if the query specifies any
-     weights.  This protects against giving wrong answers due to failure
-     to recheck the weights.
-    </para>
-   </listitem>
-  </itemizedlist>
-
-  <para>
-   In short, you must use <literal>@@@</> rather than <literal>@@</> to
-   perform GIN index searches on queries that involve weight restrictions.
-   For queries that do not have weight restrictions, either operator will
-   work, but <literal>@@</> will be faster.
-   This awkwardness will probably be addressed in a future release of
-   <productname>PostgreSQL</>.
+   GIN indexes are not lossy for standard queries, but their performance
+   depends logarithmically on the number of unique words.
+   (However, GIN indexes store only the words (lexemes) of <type>tsvector</>
+   values, and not their weight labels.  Thus a table row recheck is needed
+   when using a query that involves weights.)
   </para>
 
   <para>
index 9486d2aec850c133cf580ec3d6c0ddf58820d224..544e94c31a7791abfebf168a19ea55ccefee7e17 100644 (file)
@@ -913,26 +913,31 @@ ALTER OPERATOR FAMILY integer_ops USING btree ADD
 
   <para>
    Normally, declaring an operator as a member of an operator class
-   (or family) means
-   that the index method can retrieve exactly the set of rows
+   (or family) means that the index method can retrieve exactly the set of rows
    that satisfy a <literal>WHERE</> condition using the operator.  For example:
 <programlisting>
 SELECT * FROM table WHERE integer_column &lt; 4;
 </programlisting>
    can be satisfied exactly by a B-tree index on the integer column.
    But there are cases where an index is useful as an inexact guide to
-   the matching rows.  For example, if a GiST index stores only
-   bounding boxes for objects, then it cannot exactly satisfy a <literal>WHERE</>
+   the matching rows.  For example, if a GiST index stores only bounding boxes
+   for geometric objects, then it cannot exactly satisfy a <literal>WHERE</> 
    condition that tests overlap between nonrectangular objects such as
    polygons.  Yet we could use the index to find objects whose bounding
    box overlaps the bounding box of the target object, and then do the
    exact overlap test only on the objects found by the index.  If this
    scenario applies, the index is said to be <quote>lossy</> for the
-   operator, and we add <literal>RECHECK</> to the <literal>OPERATOR</> clause
-   in the <command>CREATE OPERATOR CLASS</> command.
-   <literal>RECHECK</> is valid if the index is guaranteed to return
-   all the required rows, plus perhaps some additional rows, which
-   can be eliminated by performing the original operator invocation.
+   operator.  Lossy index searches are implemented by having the index
+   method return a <firstterm>recheck</> flag when a row might or might
+   not really satisfy the query condition.  The core system will then
+   test the original query condition on the retrieved row to see whether
+   it should be returned as a valid match.  This approach works if
+   the index is guaranteed to return all the required rows, plus perhaps
+   some additional rows, which can be eliminated by performing the original
+   operator invocation.  The index methods that support lossy searches
+   (currently, GiST and GIN) allow the support functions of individual
+   operator classes to set the recheck flag, and so this is essentially an
+   operator-class feature.
   </para>
 
   <para>
index 2bf09f36e197f8284a7dbbd5c4deca0109a2f442..4c6ea99e28eec88e05930565667cba3e05109bce 100644 (file)
@@ -95,8 +95,9 @@ ginarrayconsistent(PG_FUNCTION_ARGS)
        bool       *check = (bool *) PG_GETARG_POINTER(0);
        StrategyNumber strategy = PG_GETARG_UINT16(1);
        ArrayType  *query = PG_GETARG_ARRAYTYPE_P(2);
-       int                     res,
-                               i,
+       bool       *recheck = (bool *) PG_GETARG_POINTER(3);
+       bool            res;
+       int                     i,
                                nentries;
 
        /* ARRAYCHECK was already done by previous ginarrayextract call */
@@ -104,25 +105,51 @@ ginarrayconsistent(PG_FUNCTION_ARGS)
        switch (strategy)
        {
                case GinOverlapStrategy:
+                       /* result is not lossy */
+                       *recheck = false;
+                       /* at least one element in check[] is true, so result = true */
+                       res = true;
+                       break;
                case GinContainedStrategy:
+                       /* we will need recheck */
+                       *recheck = true;
                        /* at least one element in check[] is true, so result = true */
-                       res = TRUE;
+                       res = true;
                        break;
                case GinContainsStrategy:
+                       /* result is not lossy */
+                       *recheck = false;
+                       /* must have all elements in check[] true */
+                       nentries = ArrayGetNItems(ARR_NDIM(query), ARR_DIMS(query));
+                       res = true;
+                       for (i = 0; i < nentries; i++)
+                       {
+                               if (!check[i])
+                               {
+                                       res = false;
+                                       break;
+                               }
+                       }
+                       break;
                case GinEqualStrategy:
+                       /* we will need recheck */
+                       *recheck = true;
+                       /* must have all elements in check[] true */
                        nentries = ArrayGetNItems(ARR_NDIM(query), ARR_DIMS(query));
-                       res = TRUE;
+                       res = true;
                        for (i = 0; i < nentries; i++)
+                       {
                                if (!check[i])
                                {
-                                       res = FALSE;
+                                       res = false;
                                        break;
                                }
+                       }
                        break;
                default:
                        elog(ERROR, "ginarrayconsistent: unknown strategy number: %d",
                                 strategy);
-                       res = FALSE;
+                       res = false;
        }
 
        PG_RETURN_BOOL(res);
index dd291ca1489bb1b7411088220483dba42feca3b2..58502a0edca302e918800952cc5cf77a87f8fd0f 100644 (file)
@@ -343,10 +343,12 @@ entryGetItem(Relation index, GinScanEntry entry)
 
 /*
  * Sets key->curItem to new found heap item pointer for one scan key
- * returns isFinished!
+ * Returns isFinished, ie TRUE means we did NOT get a new item pointer!
+ * Also, *keyrecheck is set true if recheck is needed for this scan key.
  */
 static bool
-keyGetItem(Relation index, GinState *ginstate, MemoryContext tempCtx, GinScanKey key)
+keyGetItem(Relation index, GinState *ginstate, MemoryContext tempCtx,
+                  GinScanKey key, bool *keyrecheck)
 {
        uint32          i;
        GinScanEntry entry;
@@ -391,31 +393,36 @@ keyGetItem(Relation index, GinState *ginstate, MemoryContext tempCtx, GinScanKey
                        return TRUE;
                }
 
-               if (key->nentries == 1)
-               {
-                       /* we can do not call consistentFn !! */
-                       key->entryRes[0] = TRUE;
-                       return FALSE;
-               }
+               /*
+                * if key->nentries == 1 then the consistentFn should always succeed,
+                * but we must call it anyway to find out the recheck status.
+                */
 
                /* setting up array for consistentFn */
                for (i = 0; i < key->nentries; i++)
                {
                        entry = key->scanEntry + i;
 
-                       if (entry->isFinished == FALSE && compareItemPointers(&entry->curItem, &key->curItem) == 0)
+                       if (entry->isFinished == FALSE &&
+                               compareItemPointers(&entry->curItem, &key->curItem) == 0)
                                key->entryRes[i] = TRUE;
                        else
                                key->entryRes[i] = FALSE;
                }
 
+               /*
+                * Initialize *keyrecheck in case the consistentFn doesn't know it
+                * should set it.  The safe assumption in that case is to force
+                * recheck.
+                */
+               *keyrecheck = true;
+
                oldCtx = MemoryContextSwitchTo(tempCtx);
-               res = DatumGetBool(FunctionCall3(
-                                                                                &ginstate->consistentFn,
+               res = DatumGetBool(FunctionCall4(&ginstate->consistentFn,
                                                                                 PointerGetDatum(key->entryRes),
                                                                                 UInt16GetDatum(key->strategy),
-                                                                                key->query
-                                                                                ));
+                                                                                key->query,
+                                                                                PointerGetDatum(keyrecheck)));
                MemoryContextSwitchTo(oldCtx);
                MemoryContextReset(tempCtx);
        } while (!res);
@@ -430,24 +437,32 @@ keyGetItem(Relation index, GinState *ginstate, MemoryContext tempCtx, GinScanKey
 static bool
 scanGetItem(IndexScanDesc scan, ItemPointerData *item, bool *recheck)
 {
-       uint32          i;
        GinScanOpaque so = (GinScanOpaque) scan->opaque;
-
-       /* XXX for the moment, treat all GIN operators as lossy */
-       *recheck = true;
+       uint32          i;
+       bool            keyrecheck;
+
+       /*
+        * We return recheck = true if any of the keyGetItem calls return
+        * keyrecheck = true.  Note that because the second loop might advance
+        * some keys, this could theoretically be too conservative.  In practice
+        * though, we expect that a consistentFn's recheck result will depend
+        * only on the operator and the query, so for any one key it should
+        * stay the same regardless of advancing to new items.  So it's not
+        * worth working harder.
+        */
+       *recheck = false;
 
        ItemPointerSetMin(item);
        for (i = 0; i < so->nkeys; i++)
        {
                GinScanKey      key = so->keys + i;
 
-               if (keyGetItem(scan->indexRelation, &so->ginstate, so->tempCtx, key) == FALSE)
-               {
-                       if (compareItemPointers(item, &key->curItem) < 0)
-                               *item = key->curItem;
-               }
-               else
+               if (keyGetItem(scan->indexRelation, &so->ginstate, so->tempCtx,
+                                          key, &keyrecheck))
                        return FALSE;           /* finished one of keys */
+               if (compareItemPointers(item, &key->curItem) < 0)
+                       *item = key->curItem;
+               *recheck |= keyrecheck;
        }
 
        for (i = 1; i <= so->nkeys; i++)
@@ -462,8 +477,10 @@ scanGetItem(IndexScanDesc scan, ItemPointerData *item, bool *recheck)
                                break;
                        else if (cmp > 0)
                        {
-                               if (keyGetItem(scan->indexRelation, &so->ginstate, so->tempCtx, key) == TRUE)
+                               if (keyGetItem(scan->indexRelation, &so->ginstate, so->tempCtx,
+                                                          key, &keyrecheck))
                                        return FALSE;           /* finished one of keys */
+                               *recheck |= keyrecheck;
                        }
                        else
                        {                                       /* returns to begin */
index c852770989a63c55001088b8298c3632b32b2ee2..df0e80e4f764a5a4e561f47a4b1d2c5fa51866fb 100644 (file)
@@ -151,7 +151,6 @@ gistnext(IndexScanDesc scan, ScanDirection dir, TIDBitmap *tbm)
        GISTScanOpaque so;
        GISTSearchStack *stk;
        IndexTuple      it;
-       bool            recheck;
        GISTPageOpaque opaque;
        bool            resetoffset = false;
        int64           ntids = 0;
@@ -257,8 +256,6 @@ gistnext(IndexScanDesc scan, ScanDirection dir, TIDBitmap *tbm)
                for (;;)
                {
                        n = gistfindnext(scan, n, dir);
-                       /* XXX for the moment, treat all GIST operators as lossy */
-                       recheck = true;
 
                        if (!OffsetNumberIsValid(n))
                        {
@@ -304,11 +301,11 @@ gistnext(IndexScanDesc scan, ScanDirection dir, TIDBitmap *tbm)
                                        it = (IndexTuple) PageGetItem(p, PageGetItemId(p, n));
                                        ntids++;
                                        if (tbm != NULL)
-                                               tbm_add_tuples(tbm, &it->t_tid, 1, recheck);
+                                               tbm_add_tuples(tbm, &it->t_tid, 1, scan->xs_recheck);
                                        else 
                                        {
                                                scan->xs_ctup.t_self = it->t_tid;
-                                               scan->xs_recheck = recheck;
+                                               /* scan->xs_recheck is already set */
 
                                                LockBuffer(so->curbuf, GIST_UNLOCK);
                                                return ntids; /* always 1 */
@@ -345,6 +342,10 @@ gistnext(IndexScanDesc scan, ScanDirection dir, TIDBitmap *tbm)
 /*
  * gistindex_keytest() -- does this index tuple satisfy the scan key(s)?
  *
+ * On success return for a leaf tuple, scan->xs_recheck is set to indicate
+ * whether recheck is needed.  We recheck if any of the consistent() functions
+ * request it.
+ *
  * We must decompress the key in the IndexTuple before passing it to the
  * sk_func (and we have previously overwritten the sk_func to use the
  * user-defined Consistent method, so we actually are invoking that).
@@ -371,6 +372,8 @@ gistindex_keytest(IndexTuple tuple,
 
        IncrIndexProcessed();
 
+       scan->xs_recheck = false;
+
        /*
         * Tuple doesn't restore after crash recovery because of incomplete insert
         */
@@ -382,6 +385,7 @@ gistindex_keytest(IndexTuple tuple,
                Datum           datum;
                bool            isNull;
                Datum           test;
+               bool            recheck;
                GISTENTRY       de;
 
                datum = index_getattr(tuple,
@@ -408,7 +412,6 @@ gistindex_keytest(IndexTuple tuple,
                }
                else
                {
-
                        gistdentryinit(giststate, key->sk_attno - 1, &de,
                                                   datum, r, p, offset,
                                                   FALSE, isNull);
@@ -416,21 +419,28 @@ gistindex_keytest(IndexTuple tuple,
                        /*
                         * Call the Consistent function to evaluate the test.  The
                         * arguments are the index datum (as a GISTENTRY*), the comparison
-                        * datum, and the comparison operator's strategy number and
-                        * subtype from pg_amop.
+                        * datum, the comparison operator's strategy number and
+                        * subtype from pg_amop, and the recheck flag.
                         *
                         * (Presently there's no need to pass the subtype since it'll
                         * always be zero, but might as well pass it for possible future
                         * use.)
+                        *
+                        * We initialize the recheck flag to true (the safest assumption)
+                        * in case the Consistent function forgets to set it.
                         */
-                       test = FunctionCall4(&key->sk_func,
+                       recheck = true;
+
+                       test = FunctionCall5(&key->sk_func,
                                                                 PointerGetDatum(&de),
                                                                 key->sk_argument,
                                                                 Int32GetDatum(key->sk_strategy),
-                                                                ObjectIdGetDatum(key->sk_subtype));
+                                                                ObjectIdGetDatum(key->sk_subtype),
+                                                                PointerGetDatum(&recheck));
 
                        if (!DatumGetBool(test))
                                return false;
+                       scan->xs_recheck |= recheck;
                }
 
                keySize--;
@@ -444,6 +454,7 @@ gistindex_keytest(IndexTuple tuple,
  * Return the offset of the first index entry that is consistent with
  * the search key after offset 'n' in the current page. If there are
  * no more consistent entries, return InvalidOffsetNumber.
+ * On success, scan->xs_recheck is set correctly, too.
  * Page should be locked....
  */
 static OffsetNumber
index 51679d192e65b638d8e2e6da1cf4f4263f187b99..8dd482bafd15362201e2a480fea7fb1f1f419f7d 100644 (file)
@@ -86,6 +86,11 @@ gist_box_consistent(PG_FUNCTION_ARGS)
        GISTENTRY  *entry = (GISTENTRY *) PG_GETARG_POINTER(0);
        BOX                *query = PG_GETARG_BOX_P(1);
        StrategyNumber strategy = (StrategyNumber) PG_GETARG_UINT16(2);
+       /* Oid          subtype = PG_GETARG_OID(3); */
+       bool       *recheck = (bool *) PG_GETARG_POINTER(4);
+
+       /* All cases served by this function are exact */
+       *recheck = false;
 
        if (DatumGetBoxP(entry->key) == NULL || query == NULL)
                PG_RETURN_BOOL(FALSE);
@@ -723,13 +728,18 @@ gist_poly_consistent(PG_FUNCTION_ARGS)
        GISTENTRY  *entry = (GISTENTRY *) PG_GETARG_POINTER(0);
        POLYGON    *query = PG_GETARG_POLYGON_P(1);
        StrategyNumber strategy = (StrategyNumber) PG_GETARG_UINT16(2);
+       /* Oid          subtype = PG_GETARG_OID(3); */
+       bool       *recheck = (bool *) PG_GETARG_POINTER(4);
        bool            result;
 
+       /* All cases served by this function are inexact */
+       *recheck = true;
+
        if (DatumGetBoxP(entry->key) == NULL || query == NULL)
                PG_RETURN_BOOL(FALSE);
 
        /*
-        * Since the operators are marked lossy anyway, we can just use
+        * Since the operators require recheck anyway, we can just use
         * rtree_internal_consistent even at leaf nodes.  (This works in part
         * because the index entries are bounding boxes not polygons.)
         */
@@ -794,14 +804,19 @@ gist_circle_consistent(PG_FUNCTION_ARGS)
        GISTENTRY  *entry = (GISTENTRY *) PG_GETARG_POINTER(0);
        CIRCLE     *query = PG_GETARG_CIRCLE_P(1);
        StrategyNumber strategy = (StrategyNumber) PG_GETARG_UINT16(2);
+       /* Oid          subtype = PG_GETARG_OID(3); */
+       bool       *recheck = (bool *) PG_GETARG_POINTER(4);
        BOX                     bbox;
        bool            result;
 
+       /* All cases served by this function are inexact */
+       *recheck = true;
+
        if (DatumGetBoxP(entry->key) == NULL || query == NULL)
                PG_RETURN_BOOL(FALSE);
 
        /*
-        * Since the operators are marked lossy anyway, we can just use
+        * Since the operators require recheck anyway, we can just use
         * rtree_internal_consistent even at leaf nodes.  (This works in part
         * because the index entries are bounding boxes not circles.)
         */
index e7fcee8194a4ff453e2edc5153959f0a9277ed59..4a18c568f65082d0cd877d8480f755095cb08d70 100644 (file)
@@ -52,7 +52,6 @@ typedef struct
        int                     number;                 /* strategy or support proc number */
        Oid                     lefttype;               /* lefttype */
        Oid                     righttype;              /* righttype */
-       bool            recheck;                /* oper recheck flag (unused for proc) */
 } OpFamilyMember;
 
 
@@ -445,7 +444,6 @@ DefineOpClass(CreateOpClassStmt *stmt)
                                member = (OpFamilyMember *) palloc0(sizeof(OpFamilyMember));
                                member->object = operOid;
                                member->number = item->number;
-                               member->recheck = item->recheck;
                                assignOperTypes(member, amoid, typeoid);
                                addFamilyMember(&operators, member, false);
                                break;
@@ -898,7 +896,6 @@ AlterOpFamilyAdd(List *opfamilyname, Oid amoid, Oid opfamilyoid,
                                member = (OpFamilyMember *) palloc0(sizeof(OpFamilyMember));
                                member->object = operOid;
                                member->number = item->number;
-                               member->recheck = item->recheck;
                                assignOperTypes(member, amoid, InvalidOid);
                                addFamilyMember(&operators, member, false);
                                break;
@@ -1266,7 +1263,6 @@ storeOperators(List *opfamilyname, Oid amoid,
                values[Anum_pg_amop_amoplefttype - 1] = ObjectIdGetDatum(op->lefttype);
                values[Anum_pg_amop_amoprighttype - 1] = ObjectIdGetDatum(op->righttype);
                values[Anum_pg_amop_amopstrategy - 1] = Int16GetDatum(op->number);
-               values[Anum_pg_amop_amopreqcheck - 1] = BoolGetDatum(op->recheck);
                values[Anum_pg_amop_amopopr - 1] = ObjectIdGetDatum(op->object);
                values[Anum_pg_amop_amopmethod - 1] = ObjectIdGetDatum(amoid);
 
index 5f0e7fa43bc6a21316fccd839a46fcac15b3a7ff..7bf301d02e1c28ae6c973c8e6a07c5bd0a5099e7 100644 (file)
@@ -2471,7 +2471,6 @@ _copyCreateOpClassItem(CreateOpClassItem *from)
        COPY_NODE_FIELD(name);
        COPY_NODE_FIELD(args);
        COPY_SCALAR_FIELD(number);
-       COPY_SCALAR_FIELD(recheck);
        COPY_NODE_FIELD(class_args);
        COPY_NODE_FIELD(storedtype);
 
index 7645e45eb18d41d3eb2d46a5f3f892f329437561..6bd5c2c209176358a2707ce47ba69f45f94395dd 100644 (file)
@@ -1275,7 +1275,6 @@ _equalCreateOpClassItem(CreateOpClassItem *a, CreateOpClassItem *b)
        COMPARE_NODE_FIELD(name);
        COMPARE_NODE_FIELD(args);
        COMPARE_SCALAR_FIELD(number);
-       COMPARE_SCALAR_FIELD(recheck);
        COMPARE_NODE_FIELD(class_args);
        COMPARE_NODE_FIELD(storedtype);
 
index efd50f6d479c61f3d8270441ba08d01b606155a8..fe06f3a8e5d90ed52e9aa6d6c2dfb4e911807874 100644 (file)
@@ -3107,7 +3107,6 @@ opclass_item:
                                        n->name = $3;
                                        n->args = NIL;
                                        n->number = $2;
-                                       n->recheck = $4;
                                        $$ = (Node *) n;
                                }
                        | OPERATOR Iconst any_operator '(' oper_argtypes ')' opt_recheck
@@ -3117,7 +3116,6 @@ opclass_item:
                                        n->name = $3;
                                        n->args = $5;
                                        n->number = $2;
-                                       n->recheck = $7;
                                        $$ = (Node *) n;
                                }
                        | FUNCTION Iconst func_name func_args
@@ -3156,7 +3154,14 @@ opt_opfamily:    FAMILY any_name                         { $$ = $2; }
                        | /*EMPTY*/                                             { $$ = NIL; }
                ;
 
-opt_recheck:   RECHECK                                         { $$ = TRUE; }
+opt_recheck:   RECHECK
+                               {
+                                       ereport(ERROR,
+                                                       (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+                                                        errmsg("RECHECK is no longer supported"),
+                                                        errhint("Update your data type.")));
+                                       $$ = TRUE;
+                               }
                        | /*EMPTY*/                                             { $$ = FALSE; }
                ;
 
index fd79d1d1761f475e9effb5436fd46d62ee6ed2de..7706fabd3e30f2ab709ce316326d5f3b785b5cb6 100644 (file)
@@ -54,7 +54,7 @@ gin_extract_tsquery(PG_FUNCTION_ARGS)
 {
        TSQuery         query = PG_GETARG_TSQUERY(0);
        int32      *nentries = (int32 *) PG_GETARG_POINTER(1);
-       StrategyNumber strategy = PG_GETARG_UINT16(2);
+       /* StrategyNumber strategy = PG_GETARG_UINT16(2); */
        Datum      *entries = NULL;
 
        *nentries = 0;
@@ -89,12 +89,6 @@ gin_extract_tsquery(PG_FUNCTION_ARGS)
                                txt = cstring_to_text_with_len(GETOPERAND(query) + val->distance,
                                                                                           val->length);
                                entries[j++] = PointerGetDatum(txt);
-
-                               if (strategy != TSearchWithClassStrategyNumber && val->weight != 0)
-                                       ereport(ERROR,
-                                                       (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
-                                                        errmsg("@@ operator does not support lexeme weight restrictions in GIN index searches"),
-                                                        errhint("Use the @@@ operator instead.")));
                        }
        }
        else
@@ -109,6 +103,7 @@ typedef struct
 {
        QueryItem  *frst;
        bool       *mapped_check;
+       bool       *need_recheck;
 } GinChkVal;
 
 static bool
@@ -116,6 +111,10 @@ checkcondition_gin(void *checkval, QueryOperand *val)
 {
        GinChkVal  *gcv = (GinChkVal *) checkval;
 
+       /* if any val requiring a weight is used, set recheck flag */
+       if (val->weight != 0)
+               *(gcv->need_recheck) = true;
+
        return gcv->mapped_check[((QueryItem *) val) - gcv->frst];
 }
 
@@ -125,8 +124,12 @@ gin_tsquery_consistent(PG_FUNCTION_ARGS)
        bool       *check = (bool *) PG_GETARG_POINTER(0);
        /* StrategyNumber strategy = PG_GETARG_UINT16(1); */
        TSQuery         query = PG_GETARG_TSQUERY(2);
+       bool       *recheck = (bool *) PG_GETARG_POINTER(3);
        bool            res = FALSE;
 
+       /* The query requires recheck only if it involves weights */
+       *recheck = false;
+
        if (query->size > 0)
        {
                int                     i,
@@ -144,6 +147,7 @@ gin_tsquery_consistent(PG_FUNCTION_ARGS)
 
                gcv.frst = item = GETQUERY(query);
                gcv.mapped_check = (bool *) palloc(sizeof(bool) * query->size);
+               gcv.need_recheck = recheck;
 
                for (i = 0; i < query->size; i++)
                        if (item[i].type == QI_VAL)
index 8731edbcfa285141e3ae73d06ee5bd700301f2d7..db6846aa2fc03ec02c0b76ae5fb8870b54c0c402 100644 (file)
@@ -330,10 +330,15 @@ checkcondition_bit(void *checkval, QueryOperand *val)
 Datum
 gtsvector_consistent(PG_FUNCTION_ARGS)
 {
+       GISTENTRY  *entry = (GISTENTRY *) PG_GETARG_POINTER(0);
        TSQuery         query = PG_GETARG_TSQUERY(1);
-       SignTSVector *key = (SignTSVector *) DatumGetPointer(
-                                                                       ((GISTENTRY *) PG_GETARG_POINTER(0))->key
-       );
+       /* StrategyNumber strategy = (StrategyNumber) PG_GETARG_UINT16(2); */
+       /* Oid          subtype = PG_GETARG_OID(3); */
+       bool       *recheck = (bool *) PG_GETARG_POINTER(4);
+       SignTSVector *key = (SignTSVector *) DatumGetPointer(entry->key);
+
+       /* All cases served by this function are inexact */
+       *recheck = true;
 
        if (!query->size)
                PG_RETURN_BOOL(false);
index eb92bffa38938a5fb54185140c51b497908e83c6..eb97baa360bf9d02b8e4d3aaf23834bb6db4080f 100644 (file)
@@ -52,12 +52,17 @@ Datum
 gtsquery_consistent(PG_FUNCTION_ARGS)
 {
        GISTENTRY  *entry = (GISTENTRY *) PG_GETARG_POINTER(0);
-       TSQuerySign *key = (TSQuerySign *) DatumGetPointer(entry->key);
        TSQuery         query = PG_GETARG_TSQUERY(1);
        StrategyNumber strategy = (StrategyNumber) PG_GETARG_UINT16(2);
+       /* Oid          subtype = PG_GETARG_OID(3); */
+       bool       *recheck = (bool *) PG_GETARG_POINTER(4);
+       TSQuerySign *key = (TSQuerySign *) DatumGetPointer(entry->key);
        TSQuerySign sq = makeTSQuerySign(query);
        bool            retval;
 
+       /* All cases served by this function are inexact */
+       *recheck = true;
+
        switch (strategy)
        {
                case RTContainsStrategyNumber:
index f1142b74c33ce2a8924a759e0df1bf36cb959cf8..36ba4575c584874a39aacae5b4323d222d052f97 100644 (file)
@@ -7456,7 +7456,27 @@ dumpOpclass(Archive *fout, OpclassInfo *opcinfo)
         */
        resetPQExpBuffer(query);
 
-       if (g_fout->remoteVersion >= 80300)
+       if (g_fout->remoteVersion >= 80400)
+       {
+               /*
+                * Print only those opfamily members that are tied to the opclass by
+                * pg_depend entries.
+                *
+                * XXX RECHECK is gone as of 8.4, but we'll still print it if dumping
+                * an older server's table in which it is used.  Would it be better
+                * to silently ignore it?
+                */
+               appendPQExpBuffer(query, "SELECT amopstrategy, false as amopreqcheck, "
+                                                 "amopopr::pg_catalog.regoperator "
+                                                 "FROM pg_catalog.pg_amop ao, pg_catalog.pg_depend "
+                  "WHERE refclassid = 'pg_catalog.pg_opclass'::pg_catalog.regclass "
+                                                 "AND refobjid = '%u'::pg_catalog.oid "
+                                  "AND classid = 'pg_catalog.pg_amop'::pg_catalog.regclass "
+                                                 "AND objid = ao.oid "
+                                                 "ORDER BY amopstrategy",
+                                                 opcinfo->dobj.catId.oid);
+       }
+       else if (g_fout->remoteVersion >= 80300)
        {
                /*
                 * Print only those opfamily members that are tied to the opclass by
@@ -7649,7 +7669,26 @@ dumpOpfamily(Archive *fout, OpfamilyInfo *opfinfo)
         * Fetch only those opfamily members that are tied directly to the
         * opfamily by pg_depend entries.
         */
-       appendPQExpBuffer(query, "SELECT amopstrategy, amopreqcheck, "
+       if (g_fout->remoteVersion >= 80400)
+       {
+               /*
+                * XXX RECHECK is gone as of 8.4, but we'll still print it if dumping
+                * an older server's table in which it is used.  Would it be better
+                * to silently ignore it?
+                */
+               appendPQExpBuffer(query, "SELECT amopstrategy, false as amopreqcheck, "
+                                         "amopopr::pg_catalog.regoperator "
+                                         "FROM pg_catalog.pg_amop ao, pg_catalog.pg_depend "
+                 "WHERE refclassid = 'pg_catalog.pg_opfamily'::pg_catalog.regclass "
+                                         "AND refobjid = '%u'::pg_catalog.oid "
+                                  "AND classid = 'pg_catalog.pg_amop'::pg_catalog.regclass "
+                                         "AND objid = ao.oid "
+                                         "ORDER BY amopstrategy",
+                                         opfinfo->dobj.catId.oid);
+       }
+       else
+       {
+               appendPQExpBuffer(query, "SELECT amopstrategy, amopreqcheck, "
                                          "amopopr::pg_catalog.regoperator "
                                          "FROM pg_catalog.pg_amop ao, pg_catalog.pg_depend "
                  "WHERE refclassid = 'pg_catalog.pg_opfamily'::pg_catalog.regclass "
@@ -7658,6 +7697,7 @@ dumpOpfamily(Archive *fout, OpfamilyInfo *opfinfo)
                                          "AND objid = ao.oid "
                                          "ORDER BY amopstrategy",
                                          opfinfo->dobj.catId.oid);
+       }
 
        res_ops = PQexec(g_conn, query->data);
        check_sql_result(res_ops, g_conn, query->data, PGRES_TUPLES_OK);
index 5f44d0e85d91ca956b43d26de98df9c38f863174..1f518421f05d7e736f95a1b3c4cab9d77d8fda59 100644 (file)
@@ -53,6 +53,6 @@
  */
 
 /*                                                     yyyymmddN */
-#define CATALOG_VERSION_NO     200804101
+#define CATALOG_VERSION_NO     200804141
 
 #endif
index 3a6ee11f26bbafe0978f0b0eefa644af17fcfe75..1edcd64285b820539d7f09d3a6cb37ea73434803 100644 (file)
@@ -55,7 +55,6 @@ CATALOG(pg_amop,2602)
        Oid                     amoplefttype;   /* operator's left input data type */
        Oid                     amoprighttype;  /* operator's right input data type */
        int2            amopstrategy;   /* operator strategy number */
-       bool            amopreqcheck;   /* index hit must be rechecked */
        Oid                     amopopr;                /* the operator's pg_operator OID */
        Oid                     amopmethod;             /* the index access method this entry is for */
 } FormData_pg_amop;
@@ -71,14 +70,13 @@ typedef FormData_pg_amop *Form_pg_amop;
  *             compiler constants for pg_amop
  * ----------------
  */
-#define Natts_pg_amop                                  7
+#define Natts_pg_amop                                  6
 #define Anum_pg_amop_amopfamily                        1
 #define Anum_pg_amop_amoplefttype              2
 #define Anum_pg_amop_amoprighttype             3
 #define Anum_pg_amop_amopstrategy              4
-#define Anum_pg_amop_amopreqcheck              5
-#define Anum_pg_amop_amopopr                   6
-#define Anum_pg_amop_amopmethod                        7
+#define Anum_pg_amop_amopopr                   5
+#define Anum_pg_amop_amopmethod                        6
 
 /* ----------------
  *             initial contents of pg_amop
@@ -90,596 +88,596 @@ typedef FormData_pg_amop *Form_pg_amop;
  */
 
 /* default operators int2 */
-DATA(insert (  1976   21 21 1 f  95    403 ));
-DATA(insert (  1976   21 21 2 f  522   403 ));
-DATA(insert (  1976   21 21 3 f  94    403 ));
-DATA(insert (  1976   21 21 4 f  524   403 ));
-DATA(insert (  1976   21 21 5 f  520   403 ));
+DATA(insert (  1976   21 21 1  95      403 ));
+DATA(insert (  1976   21 21 2  522     403 ));
+DATA(insert (  1976   21 21 3  94      403 ));
+DATA(insert (  1976   21 21 4  524     403 ));
+DATA(insert (  1976   21 21 5  520     403 ));
 /* crosstype operators int24 */
-DATA(insert (  1976   21 23 1 f  534   403 ));
-DATA(insert (  1976   21 23 2 f  540   403 ));
-DATA(insert (  1976   21 23 3 f  532   403 ));
-DATA(insert (  1976   21 23 4 f  542   403 ));
-DATA(insert (  1976   21 23 5 f  536   403 ));
+DATA(insert (  1976   21 23 1  534     403 ));
+DATA(insert (  1976   21 23 2  540     403 ));
+DATA(insert (  1976   21 23 3  532     403 ));
+DATA(insert (  1976   21 23 4  542     403 ));
+DATA(insert (  1976   21 23 5  536     403 ));
 /* crosstype operators int28 */
-DATA(insert (  1976   21 20 1 f  1864  403 ));
-DATA(insert (  1976   21 20 2 f  1866  403 ));
-DATA(insert (  1976   21 20 3 f  1862  403 ));
-DATA(insert (  1976   21 20 4 f  1867  403 ));
-DATA(insert (  1976   21 20 5 f  1865  403 ));
+DATA(insert (  1976   21 20 1  1864    403 ));
+DATA(insert (  1976   21 20 2  1866    403 ));
+DATA(insert (  1976   21 20 3  1862    403 ));
+DATA(insert (  1976   21 20 4  1867    403 ));
+DATA(insert (  1976   21 20 5  1865    403 ));
 /* default operators int4 */
-DATA(insert (  1976   23 23 1 f  97    403 ));
-DATA(insert (  1976   23 23 2 f  523   403 ));
-DATA(insert (  1976   23 23 3 f  96    403 ));
-DATA(insert (  1976   23 23 4 f  525   403 ));
-DATA(insert (  1976   23 23 5 f  521   403 ));
+DATA(insert (  1976   23 23 1  97      403 ));
+DATA(insert (  1976   23 23 2  523     403 ));
+DATA(insert (  1976   23 23 3  96      403 ));
+DATA(insert (  1976   23 23 4  525     403 ));
+DATA(insert (  1976   23 23 5  521     403 ));
 /* crosstype operators int42 */
-DATA(insert (  1976   23 21 1 f  535   403 ));
-DATA(insert (  1976   23 21 2 f  541   403 ));
-DATA(insert (  1976   23 21 3 f  533   403 ));
-DATA(insert (  1976   23 21 4 f  543   403 ));
-DATA(insert (  1976   23 21 5 f  537   403 ));
+DATA(insert (  1976   23 21 1  535     403 ));
+DATA(insert (  1976   23 21 2  541     403 ));
+DATA(insert (  1976   23 21 3  533     403 ));
+DATA(insert (  1976   23 21 4  543     403 ));
+DATA(insert (  1976   23 21 5  537     403 ));
 /* crosstype operators int48 */
-DATA(insert (  1976   23 20 1 f  37    403 ));
-DATA(insert (  1976   23 20 2 f  80    403 ));
-DATA(insert (  1976   23 20 3 f  15    403 ));
-DATA(insert (  1976   23 20 4 f  82    403 ));
-DATA(insert (  1976   23 20 5 f  76    403 ));
+DATA(insert (  1976   23 20 1  37      403 ));
+DATA(insert (  1976   23 20 2  80      403 ));
+DATA(insert (  1976   23 20 3  15      403 ));
+DATA(insert (  1976   23 20 4  82      403 ));
+DATA(insert (  1976   23 20 5  76      403 ));
 /* default operators int8 */
-DATA(insert (  1976   20 20 1 f  412   403 ));
-DATA(insert (  1976   20 20 2 f  414   403 ));
-DATA(insert (  1976   20 20 3 f  410   403 ));
-DATA(insert (  1976   20 20 4 f  415   403 ));
-DATA(insert (  1976   20 20 5 f  413   403 ));
+DATA(insert (  1976   20 20 1  412     403 ));
+DATA(insert (  1976   20 20 2  414     403 ));
+DATA(insert (  1976   20 20 3  410     403 ));
+DATA(insert (  1976   20 20 4  415     403 ));
+DATA(insert (  1976   20 20 5  413     403 ));
 /* crosstype operators int82 */
-DATA(insert (  1976   20 21 1 f  1870  403 ));
-DATA(insert (  1976   20 21 2 f  1872  403 ));
-DATA(insert (  1976   20 21 3 f  1868  403 ));
-DATA(insert (  1976   20 21 4 f  1873  403 ));
-DATA(insert (  1976   20 21 5 f  1871  403 ));
+DATA(insert (  1976   20 21 1  1870    403 ));
+DATA(insert (  1976   20 21 2  1872    403 ));
+DATA(insert (  1976   20 21 3  1868    403 ));
+DATA(insert (  1976   20 21 4  1873    403 ));
+DATA(insert (  1976   20 21 5  1871    403 ));
 /* crosstype operators int84 */
-DATA(insert (  1976   20 23 1 f  418   403 ));
-DATA(insert (  1976   20 23 2 f  420   403 ));
-DATA(insert (  1976   20 23 3 f  416   403 ));
-DATA(insert (  1976   20 23 4 f  430   403 ));
-DATA(insert (  1976   20 23 5 f  419   403 ));
+DATA(insert (  1976   20 23 1  418     403 ));
+DATA(insert (  1976   20 23 2  420     403 ));
+DATA(insert (  1976   20 23 3  416     403 ));
+DATA(insert (  1976   20 23 4  430     403 ));
+DATA(insert (  1976   20 23 5  419     403 ));
 
 /*
  *     btree oid_ops
  */
 
-DATA(insert (  1989   26 26 1 f  609   403 ));
-DATA(insert (  1989   26 26 2 f  611   403 ));
-DATA(insert (  1989   26 26 3 f  607   403 ));
-DATA(insert (  1989   26 26 4 f  612   403 ));
-DATA(insert (  1989   26 26 5 f  610   403 ));
+DATA(insert (  1989   26 26 1  609     403 ));
+DATA(insert (  1989   26 26 2  611     403 ));
+DATA(insert (  1989   26 26 3  607     403 ));
+DATA(insert (  1989   26 26 4  612     403 ));
+DATA(insert (  1989   26 26 5  610     403 ));
 
 /*
  * btree tid_ops
  */
 
-DATA(insert (  2789   27 27 1 f 2799   403 ));
-DATA(insert (  2789   27 27 2 f 2801   403 ));
-DATA(insert (  2789   27 27 3 f 387    403 ));
-DATA(insert (  2789   27 27 4 f 2802   403 ));
-DATA(insert (  2789   27 27 5 f 2800   403 ));
+DATA(insert (  2789   27 27 1 2799     403 ));
+DATA(insert (  2789   27 27 2 2801     403 ));
+DATA(insert (  2789   27 27 3 387      403 ));
+DATA(insert (  2789   27 27 4 2802     403 ));
+DATA(insert (  2789   27 27 5 2800     403 ));
 
 /*
  *     btree oidvector_ops
  */
 
-DATA(insert (  1991   30 30 1 f  645   403 ));
-DATA(insert (  1991   30 30 2 f  647   403 ));
-DATA(insert (  1991   30 30 3 f  649   403 ));
-DATA(insert (  1991   30 30 4 f  648   403 ));
-DATA(insert (  1991   30 30 5 f  646   403 ));
+DATA(insert (  1991   30 30 1  645     403 ));
+DATA(insert (  1991   30 30 2  647     403 ));
+DATA(insert (  1991   30 30 3  649     403 ));
+DATA(insert (  1991   30 30 4  648     403 ));
+DATA(insert (  1991   30 30 5  646     403 ));
 
 /*
  *     btree float_ops
  */
 
 /* default operators float4 */
-DATA(insert (  1970   700 700 1 f      622 403 ));
-DATA(insert (  1970   700 700 2 f      624 403 ));
-DATA(insert (  1970   700 700 3 f      620 403 ));
-DATA(insert (  1970   700 700 4 f      625 403 ));
-DATA(insert (  1970   700 700 5 f      623 403 ));
+DATA(insert (  1970   700 700 1        622 403 ));
+DATA(insert (  1970   700 700 2        624 403 ));
+DATA(insert (  1970   700 700 3        620 403 ));
+DATA(insert (  1970   700 700 4        625 403 ));
+DATA(insert (  1970   700 700 5        623 403 ));
 /* crosstype operators float48 */
-DATA(insert (  1970   700 701 1 f      1122 403 ));
-DATA(insert (  1970   700 701 2 f      1124 403 ));
-DATA(insert (  1970   700 701 3 f      1120 403 ));
-DATA(insert (  1970   700 701 4 f      1125 403 ));
-DATA(insert (  1970   700 701 5 f      1123 403 ));
+DATA(insert (  1970   700 701 1        1122 403 ));
+DATA(insert (  1970   700 701 2        1124 403 ));
+DATA(insert (  1970   700 701 3        1120 403 ));
+DATA(insert (  1970   700 701 4        1125 403 ));
+DATA(insert (  1970   700 701 5        1123 403 ));
 /* default operators float8 */
-DATA(insert (  1970   701 701 1 f      672 403 ));
-DATA(insert (  1970   701 701 2 f      673 403 ));
-DATA(insert (  1970   701 701 3 f      670 403 ));
-DATA(insert (  1970   701 701 4 f      675 403 ));
-DATA(insert (  1970   701 701 5 f      674 403 ));
+DATA(insert (  1970   701 701 1        672 403 ));
+DATA(insert (  1970   701 701 2        673 403 ));
+DATA(insert (  1970   701 701 3        670 403 ));
+DATA(insert (  1970   701 701 4        675 403 ));
+DATA(insert (  1970   701 701 5        674 403 ));
 /* crosstype operators float84 */
-DATA(insert (  1970   701 700 1 f      1132 403 ));
-DATA(insert (  1970   701 700 2 f      1134 403 ));
-DATA(insert (  1970   701 700 3 f      1130 403 ));
-DATA(insert (  1970   701 700 4 f      1135 403 ));
-DATA(insert (  1970   701 700 5 f      1133 403 ));
+DATA(insert (  1970   701 700 1        1132 403 ));
+DATA(insert (  1970   701 700 2        1134 403 ));
+DATA(insert (  1970   701 700 3        1130 403 ));
+DATA(insert (  1970   701 700 4        1135 403 ));
+DATA(insert (  1970   701 700 5        1133 403 ));
 
 /*
  *     btree char_ops
  */
 
-DATA(insert (  429   18 18 1 f  631    403 ));
-DATA(insert (  429   18 18 2 f  632    403 ));
-DATA(insert (  429   18 18 3 f 92      403 ));
-DATA(insert (  429   18 18 4 f  634    403 ));
-DATA(insert (  429   18 18 5 f  633    403 ));
+DATA(insert (  429   18 18 1  631      403 ));
+DATA(insert (  429   18 18 2  632      403 ));
+DATA(insert (  429   18 18 3 92        403 ));
+DATA(insert (  429   18 18 4  634      403 ));
+DATA(insert (  429   18 18 5  633      403 ));
 
 /*
  *     btree name_ops
  */
 
-DATA(insert (  1986   19 19 1 f  660   403 ));
-DATA(insert (  1986   19 19 2 f  661   403 ));
-DATA(insert (  1986   19 19 3 f        93      403 ));
-DATA(insert (  1986   19 19 4 f  663   403 ));
-DATA(insert (  1986   19 19 5 f  662   403 ));
+DATA(insert (  1986   19 19 1  660     403 ));
+DATA(insert (  1986   19 19 2  661     403 ));
+DATA(insert (  1986   19 19 3  93      403 ));
+DATA(insert (  1986   19 19 4  663     403 ));
+DATA(insert (  1986   19 19 5  662     403 ));
 
 /*
  *     btree text_ops
  */
 
-DATA(insert (  1994   25 25 1 f  664   403 ));
-DATA(insert (  1994   25 25 2 f  665   403 ));
-DATA(insert (  1994   25 25 3 f        98      403 ));
-DATA(insert (  1994   25 25 4 f  667   403 ));
-DATA(insert (  1994   25 25 5 f  666   403 ));
+DATA(insert (  1994   25 25 1  664     403 ));
+DATA(insert (  1994   25 25 2  665     403 ));
+DATA(insert (  1994   25 25 3  98      403 ));
+DATA(insert (  1994   25 25 4  667     403 ));
+DATA(insert (  1994   25 25 5  666     403 ));
 
 /*
  *     btree bpchar_ops
  */
 
-DATA(insert (  426   1042 1042 1 f 1058        403 ));
-DATA(insert (  426   1042 1042 2 f 1059        403 ));
-DATA(insert (  426   1042 1042 3 f 1054        403 ));
-DATA(insert (  426   1042 1042 4 f 1061        403 ));
-DATA(insert (  426   1042 1042 5 f 1060        403 ));
+DATA(insert (  426   1042 1042 1 1058  403 ));
+DATA(insert (  426   1042 1042 2 1059  403 ));
+DATA(insert (  426   1042 1042 3 1054  403 ));
+DATA(insert (  426   1042 1042 4 1061  403 ));
+DATA(insert (  426   1042 1042 5 1060  403 ));
 
 /*
  *     btree bytea_ops
  */
 
-DATA(insert (  428   17 17 1 f 1957    403 ));
-DATA(insert (  428   17 17 2 f 1958    403 ));
-DATA(insert (  428   17 17 3 f 1955    403 ));
-DATA(insert (  428   17 17 4 f 1960    403 ));
-DATA(insert (  428   17 17 5 f 1959    403 ));
+DATA(insert (  428   17 17 1 1957      403 ));
+DATA(insert (  428   17 17 2 1958      403 ));
+DATA(insert (  428   17 17 3 1955      403 ));
+DATA(insert (  428   17 17 4 1960      403 ));
+DATA(insert (  428   17 17 5 1959      403 ));
 
 /*
  *     btree abstime_ops
  */
 
-DATA(insert (  421   702 702 1 f  562  403 ));
-DATA(insert (  421   702 702 2 f  564  403 ));
-DATA(insert (  421   702 702 3 f  560  403 ));
-DATA(insert (  421   702 702 4 f  565  403 ));
-DATA(insert (  421   702 702 5 f  563  403 ));
+DATA(insert (  421   702 702 1  562    403 ));
+DATA(insert (  421   702 702 2  564    403 ));
+DATA(insert (  421   702 702 3  560    403 ));
+DATA(insert (  421   702 702 4  565    403 ));
+DATA(insert (  421   702 702 5  563    403 ));
 
 /*
  *     btree datetime_ops
  */
 
 /* default operators date */
-DATA(insert (  434   1082 1082 1 f 1095        403 ));
-DATA(insert (  434   1082 1082 2 f 1096        403 ));
-DATA(insert (  434   1082 1082 3 f 1093        403 ));
-DATA(insert (  434   1082 1082 4 f 1098        403 ));
-DATA(insert (  434   1082 1082 5 f 1097        403 ));
+DATA(insert (  434   1082 1082 1 1095  403 ));
+DATA(insert (  434   1082 1082 2 1096  403 ));
+DATA(insert (  434   1082 1082 3 1093  403 ));
+DATA(insert (  434   1082 1082 4 1098  403 ));
+DATA(insert (  434   1082 1082 5 1097  403 ));
 /* crosstype operators vs timestamp */
-DATA(insert (  434   1082 1114 1 f 2345        403 ));
-DATA(insert (  434   1082 1114 2 f 2346        403 ));
-DATA(insert (  434   1082 1114 3 f 2347        403 ));
-DATA(insert (  434   1082 1114 4 f 2348        403 ));
-DATA(insert (  434   1082 1114 5 f 2349        403 ));
+DATA(insert (  434   1082 1114 1 2345  403 ));
+DATA(insert (  434   1082 1114 2 2346  403 ));
+DATA(insert (  434   1082 1114 3 2347  403 ));
+DATA(insert (  434   1082 1114 4 2348  403 ));
+DATA(insert (  434   1082 1114 5 2349  403 ));
 /* crosstype operators vs timestamptz */
-DATA(insert (  434   1082 1184 1 f 2358        403 ));
-DATA(insert (  434   1082 1184 2 f 2359        403 ));
-DATA(insert (  434   1082 1184 3 f 2360        403 ));
-DATA(insert (  434   1082 1184 4 f 2361        403 ));
-DATA(insert (  434   1082 1184 5 f 2362        403 ));
+DATA(insert (  434   1082 1184 1 2358  403 ));
+DATA(insert (  434   1082 1184 2 2359  403 ));
+DATA(insert (  434   1082 1184 3 2360  403 ));
+DATA(insert (  434   1082 1184 4 2361  403 ));
+DATA(insert (  434   1082 1184 5 2362  403 ));
 /* default operators timestamp */
-DATA(insert (  434   1114 1114 1 f 2062        403 ));
-DATA(insert (  434   1114 1114 2 f 2063        403 ));
-DATA(insert (  434   1114 1114 3 f 2060        403 ));
-DATA(insert (  434   1114 1114 4 f 2065        403 ));
-DATA(insert (  434   1114 1114 5 f 2064        403 ));
+DATA(insert (  434   1114 1114 1 2062  403 ));
+DATA(insert (  434   1114 1114 2 2063  403 ));
+DATA(insert (  434   1114 1114 3 2060  403 ));
+DATA(insert (  434   1114 1114 4 2065  403 ));
+DATA(insert (  434   1114 1114 5 2064  403 ));
 /* crosstype operators vs date */
-DATA(insert (  434   1114 1082 1 f 2371        403 ));
-DATA(insert (  434   1114 1082 2 f 2372        403 ));
-DATA(insert (  434   1114 1082 3 f 2373        403 ));
-DATA(insert (  434   1114 1082 4 f 2374        403 ));
-DATA(insert (  434   1114 1082 5 f 2375        403 ));
+DATA(insert (  434   1114 1082 1 2371  403 ));
+DATA(insert (  434   1114 1082 2 2372  403 ));
+DATA(insert (  434   1114 1082 3 2373  403 ));
+DATA(insert (  434   1114 1082 4 2374  403 ));
+DATA(insert (  434   1114 1082 5 2375  403 ));
 /* crosstype operators vs timestamptz */
-DATA(insert (  434   1114 1184 1 f 2534        403 ));
-DATA(insert (  434   1114 1184 2 f 2535        403 ));
-DATA(insert (  434   1114 1184 3 f 2536        403 ));
-DATA(insert (  434   1114 1184 4 f 2537        403 ));
-DATA(insert (  434   1114 1184 5 f 2538        403 ));
+DATA(insert (  434   1114 1184 1 2534  403 ));
+DATA(insert (  434   1114 1184 2 2535  403 ));
+DATA(insert (  434   1114 1184 3 2536  403 ));
+DATA(insert (  434   1114 1184 4 2537  403 ));
+DATA(insert (  434   1114 1184 5 2538  403 ));
 /* default operators timestamptz */
-DATA(insert (  434   1184 1184 1 f 1322        403 ));
-DATA(insert (  434   1184 1184 2 f 1323        403 ));
-DATA(insert (  434   1184 1184 3 f 1320        403 ));
-DATA(insert (  434   1184 1184 4 f 1325        403 ));
-DATA(insert (  434   1184 1184 5 f 1324        403 ));
+DATA(insert (  434   1184 1184 1 1322  403 ));
+DATA(insert (  434   1184 1184 2 1323  403 ));
+DATA(insert (  434   1184 1184 3 1320  403 ));
+DATA(insert (  434   1184 1184 4 1325  403 ));
+DATA(insert (  434   1184 1184 5 1324  403 ));
 /* crosstype operators vs date */
-DATA(insert (  434   1184 1082 1 f 2384        403 ));
-DATA(insert (  434   1184 1082 2 f 2385        403 ));
-DATA(insert (  434   1184 1082 3 f 2386        403 ));
-DATA(insert (  434   1184 1082 4 f 2387        403 ));
-DATA(insert (  434   1184 1082 5 f 2388        403 ));
+DATA(insert (  434   1184 1082 1 2384  403 ));
+DATA(insert (  434   1184 1082 2 2385  403 ));
+DATA(insert (  434   1184 1082 3 2386  403 ));
+DATA(insert (  434   1184 1082 4 2387  403 ));
+DATA(insert (  434   1184 1082 5 2388  403 ));
 /* crosstype operators vs timestamp */
-DATA(insert (  434   1184 1114 1 f 2540        403 ));
-DATA(insert (  434   1184 1114 2 f 2541        403 ));
-DATA(insert (  434   1184 1114 3 f 2542        403 ));
-DATA(insert (  434   1184 1114 4 f 2543        403 ));
-DATA(insert (  434   1184 1114 5 f 2544        403 ));
+DATA(insert (  434   1184 1114 1 2540  403 ));
+DATA(insert (  434   1184 1114 2 2541  403 ));
+DATA(insert (  434   1184 1114 3 2542  403 ));
+DATA(insert (  434   1184 1114 4 2543  403 ));
+DATA(insert (  434   1184 1114 5 2544  403 ));
 
 /*
  *     btree time_ops
  */
 
-DATA(insert (  1996   1083 1083 1 f 1110       403 ));
-DATA(insert (  1996   1083 1083 2 f 1111       403 ));
-DATA(insert (  1996   1083 1083 3 f 1108       403 ));
-DATA(insert (  1996   1083 1083 4 f 1113       403 ));
-DATA(insert (  1996   1083 1083 5 f 1112       403 ));
+DATA(insert (  1996   1083 1083 1 1110 403 ));
+DATA(insert (  1996   1083 1083 2 1111 403 ));
+DATA(insert (  1996   1083 1083 3 1108 403 ));
+DATA(insert (  1996   1083 1083 4 1113 403 ));
+DATA(insert (  1996   1083 1083 5 1112 403 ));
 
 /*
  *     btree timetz_ops
  */
 
-DATA(insert (  2000   1266 1266 1 f 1552       403 ));
-DATA(insert (  2000   1266 1266 2 f 1553       403 ));
-DATA(insert (  2000   1266 1266 3 f 1550       403 ));
-DATA(insert (  2000   1266 1266 4 f 1555       403 ));
-DATA(insert (  2000   1266 1266 5 f 1554       403 ));
+DATA(insert (  2000   1266 1266 1 1552 403 ));
+DATA(insert (  2000   1266 1266 2 1553 403 ));
+DATA(insert (  2000   1266 1266 3 1550 403 ));
+DATA(insert (  2000   1266 1266 4 1555 403 ));
+DATA(insert (  2000   1266 1266 5 1554 403 ));
 
 /*
  *     btree interval_ops
  */
 
-DATA(insert (  1982   1186 1186 1 f 1332       403 ));
-DATA(insert (  1982   1186 1186 2 f 1333       403 ));
-DATA(insert (  1982   1186 1186 3 f 1330       403 ));
-DATA(insert (  1982   1186 1186 4 f 1335       403 ));
-DATA(insert (  1982   1186 1186 5 f 1334       403 ));
+DATA(insert (  1982   1186 1186 1 1332 403 ));
+DATA(insert (  1982   1186 1186 2 1333 403 ));
+DATA(insert (  1982   1186 1186 3 1330 403 ));
+DATA(insert (  1982   1186 1186 4 1335 403 ));
+DATA(insert (  1982   1186 1186 5 1334 403 ));
 
 /*
  *     btree macaddr
  */
 
-DATA(insert (  1984   829 829 1 1222 403 ));
-DATA(insert (  1984   829 829 2 1223 403 ));
-DATA(insert (  1984   829 829 3 1220 403 ));
-DATA(insert (  1984   829 829 4 1225 403 ));
-DATA(insert (  1984   829 829 5 1224 403 ));
+DATA(insert (  1984   829 829 1 1222 403 ));
+DATA(insert (  1984   829 829 2 1223 403 ));
+DATA(insert (  1984   829 829 3 1220 403 ));
+DATA(insert (  1984   829 829 4 1225 403 ));
+DATA(insert (  1984   829 829 5 1224 403 ));
 
 /*
  *     btree network
  */
 
-DATA(insert (  1974   869 869 1 1203 403 ));
-DATA(insert (  1974   869 869 2 1204 403 ));
-DATA(insert (  1974   869 869 3 1201 403 ));
-DATA(insert (  1974   869 869 4 1206 403 ));
-DATA(insert (  1974   869 869 5 1205 403 ));
+DATA(insert (  1974   869 869 1 1203 403 ));
+DATA(insert (  1974   869 869 2 1204 403 ));
+DATA(insert (  1974   869 869 3 1201 403 ));
+DATA(insert (  1974   869 869 4 1206 403 ));
+DATA(insert (  1974   869 869 5 1205 403 ));
 
 /*
  *     btree numeric
  */
 
-DATA(insert (  1988   1700 1700 1 f 1754       403 ));
-DATA(insert (  1988   1700 1700 2 f 1755       403 ));
-DATA(insert (  1988   1700 1700 3 f 1752       403 ));
-DATA(insert (  1988   1700 1700 4 f 1757       403 ));
-DATA(insert (  1988   1700 1700 5 f 1756       403 ));
+DATA(insert (  1988   1700 1700 1 1754 403 ));
+DATA(insert (  1988   1700 1700 2 1755 403 ));
+DATA(insert (  1988   1700 1700 3 1752 403 ));
+DATA(insert (  1988   1700 1700 4 1757 403 ));
+DATA(insert (  1988   1700 1700 5 1756 403 ));
 
 /*
  *     btree bool
  */
 
-DATA(insert (  424   16 16 1 f 58      403 ));
-DATA(insert (  424   16 16 2 f 1694    403 ));
-DATA(insert (  424   16 16 3 f 91      403 ));
-DATA(insert (  424   16 16 4 f 1695    403 ));
-DATA(insert (  424   16 16 5 f 59      403 ));
+DATA(insert (  424   16 16 1 58        403 ));
+DATA(insert (  424   16 16 2 1694      403 ));
+DATA(insert (  424   16 16 3 91        403 ));
+DATA(insert (  424   16 16 4 1695      403 ));
+DATA(insert (  424   16 16 5 59        403 ));
 
 /*
  *     btree bit
  */
 
-DATA(insert (  423   1560 1560 1 f 1786        403 ));
-DATA(insert (  423   1560 1560 2 f 1788        403 ));
-DATA(insert (  423   1560 1560 3 f 1784        403 ));
-DATA(insert (  423   1560 1560 4 f 1789        403 ));
-DATA(insert (  423   1560 1560 5 f 1787        403 ));
+DATA(insert (  423   1560 1560 1 1786  403 ));
+DATA(insert (  423   1560 1560 2 1788  403 ));
+DATA(insert (  423   1560 1560 3 1784  403 ));
+DATA(insert (  423   1560 1560 4 1789  403 ));
+DATA(insert (  423   1560 1560 5 1787  403 ));
 
 /*
  *     btree varbit
  */
 
-DATA(insert (  2002   1562 1562 1 f 1806       403 ));
-DATA(insert (  2002   1562 1562 2 f 1808       403 ));
-DATA(insert (  2002   1562 1562 3 f 1804       403 ));
-DATA(insert (  2002   1562 1562 4 f 1809       403 ));
-DATA(insert (  2002   1562 1562 5 f 1807       403 ));
+DATA(insert (  2002   1562 1562 1 1806 403 ));
+DATA(insert (  2002   1562 1562 2 1808 403 ));
+DATA(insert (  2002   1562 1562 3 1804 403 ));
+DATA(insert (  2002   1562 1562 4 1809 403 ));
+DATA(insert (  2002   1562 1562 5 1807 403 ));
 
 /*
  *     btree text pattern
  */
 
-DATA(insert (  2095   25 25 1 f 2314   403 ));
-DATA(insert (  2095   25 25 2 f 2315   403 ));
-DATA(insert (  2095   25 25 3 f 2316   403 ));
-DATA(insert (  2095   25 25 4 f 2317   403 ));
-DATA(insert (  2095   25 25 5 f 2318   403 ));
+DATA(insert (  2095   25 25 1 2314     403 ));
+DATA(insert (  2095   25 25 2 2315     403 ));
+DATA(insert (  2095   25 25 3 2316     403 ));
+DATA(insert (  2095   25 25 4 2317     403 ));
+DATA(insert (  2095   25 25 5 2318     403 ));
 
 /*
  *     btree bpchar pattern
  */
 
-DATA(insert (  2097   1042 1042 1 f 2326       403 ));
-DATA(insert (  2097   1042 1042 2 f 2327       403 ));
-DATA(insert (  2097   1042 1042 3 f 2328       403 ));
-DATA(insert (  2097   1042 1042 4 f 2329       403 ));
-DATA(insert (  2097   1042 1042 5 f 2330       403 ));
+DATA(insert (  2097   1042 1042 1 2326 403 ));
+DATA(insert (  2097   1042 1042 2 2327 403 ));
+DATA(insert (  2097   1042 1042 3 2328 403 ));
+DATA(insert (  2097   1042 1042 4 2329 403 ));
+DATA(insert (  2097   1042 1042 5 2330 403 ));
 
 /*
  *     btree name pattern
  */
 
-DATA(insert (  2098   19 19 1 f 2332   403 ));
-DATA(insert (  2098   19 19 2 f 2333   403 ));
-DATA(insert (  2098   19 19 3 f 2334   403 ));
-DATA(insert (  2098   19 19 4 f 2335   403 ));
-DATA(insert (  2098   19 19 5 f 2336   403 ));
+DATA(insert (  2098   19 19 1 2332     403 ));
+DATA(insert (  2098   19 19 2 2333     403 ));
+DATA(insert (  2098   19 19 3 2334     403 ));
+DATA(insert (  2098   19 19 4 2335     403 ));
+DATA(insert (  2098   19 19 5 2336     403 ));
 
 /*
  *     btree money_ops
  */
 
-DATA(insert (  2099   790 790 1 f      902 403 ));
-DATA(insert (  2099   790 790 2 f      904 403 ));
-DATA(insert (  2099   790 790 3 f      900 403 ));
-DATA(insert (  2099   790 790 4 f      905 403 ));
-DATA(insert (  2099   790 790 5 f      903 403 ));
+DATA(insert (  2099   790 790 1        902 403 ));
+DATA(insert (  2099   790 790 2        904 403 ));
+DATA(insert (  2099   790 790 3        900 403 ));
+DATA(insert (  2099   790 790 4        905 403 ));
+DATA(insert (  2099   790 790 5        903 403 ));
 
 /*
  *     btree reltime_ops
  */
 
-DATA(insert (  2233   703 703 1 f      568 403 ));
-DATA(insert (  2233   703 703 2 f      570 403 ));
-DATA(insert (  2233   703 703 3 f      566 403 ));
-DATA(insert (  2233   703 703 4 f      571 403 ));
-DATA(insert (  2233   703 703 5 f      569 403 ));
+DATA(insert (  2233   703 703 1        568 403 ));
+DATA(insert (  2233   703 703 2        570 403 ));
+DATA(insert (  2233   703 703 3        566 403 ));
+DATA(insert (  2233   703 703 4        571 403 ));
+DATA(insert (  2233   703 703 5        569 403 ));
 
 /*
  *     btree tinterval_ops
  */
 
-DATA(insert (  2234   704 704 1 f      813 403 ));
-DATA(insert (  2234   704 704 2 f      815 403 ));
-DATA(insert (  2234   704 704 3 f      811 403 ));
-DATA(insert (  2234   704 704 4 f      816 403 ));
-DATA(insert (  2234   704 704 5 f      814 403 ));
+DATA(insert (  2234   704 704 1        813 403 ));
+DATA(insert (  2234   704 704 2        815 403 ));
+DATA(insert (  2234   704 704 3        811 403 ));
+DATA(insert (  2234   704 704 4        816 403 ));
+DATA(insert (  2234   704 704 5        814 403 ));
 
 /*
  *     btree array_ops
  */
 
-DATA(insert (  397   2277 2277 1 f 1072        403 ));
-DATA(insert (  397   2277 2277 2 f 1074        403 ));
-DATA(insert (  397   2277 2277 3 f 1070        403 ));
-DATA(insert (  397   2277 2277 4 f 1075        403 ));
-DATA(insert (  397   2277 2277 5 f 1073        403 ));
+DATA(insert (  397   2277 2277 1 1072  403 ));
+DATA(insert (  397   2277 2277 2 1074  403 ));
+DATA(insert (  397   2277 2277 3 1070  403 ));
+DATA(insert (  397   2277 2277 4 1075  403 ));
+DATA(insert (  397   2277 2277 5 1073  403 ));
 
 /*
  * btree uuid_ops
  */
 
-DATA(insert (  2968  2950 2950 1 f 2974        403 ));
-DATA(insert (  2968  2950 2950 2 f 2976        403 ));
-DATA(insert (  2968  2950 2950 3 f 2972        403 ));
-DATA(insert (  2968  2950 2950 4 f 2977        403 ));
-DATA(insert (  2968  2950 2950 5 f 2975        403 ));
+DATA(insert (  2968  2950 2950 1 2974  403 ));
+DATA(insert (  2968  2950 2950 2 2976  403 ));
+DATA(insert (  2968  2950 2950 3 2972  403 ));
+DATA(insert (  2968  2950 2950 4 2977  403 ));
+DATA(insert (  2968  2950 2950 5 2975  403 ));
 
 /*
  *     hash index _ops
  */
 
 /* bpchar_ops */
-DATA(insert (  427   1042 1042 1 f 1054        405 ));
+DATA(insert (  427   1042 1042 1 1054  405 ));
 /* char_ops */
-DATA(insert (  431   18 18 1 f 92      405 ));
+DATA(insert (  431   18 18 1 92        405 ));
 /* date_ops */
-DATA(insert (  435   1082 1082 1 f 1093        405 ));
+DATA(insert (  435   1082 1082 1 1093  405 ));
 /* float_ops */
-DATA(insert (  1971   700 700 1 f      620 405 ));
-DATA(insert (  1971   701 701 1 f      670 405 ));
-DATA(insert (  1971   700 701 1 1120 405 ));
-DATA(insert (  1971   701 700 1 1130 405 ));
+DATA(insert (  1971   700 700 1        620 405 ));
+DATA(insert (  1971   701 701 1        670 405 ));
+DATA(insert (  1971   700 701 1 1120 405 ));
+DATA(insert (  1971   701 700 1 1130 405 ));
 /* network_ops */
-DATA(insert (  1975   869 869 1 1201 405 ));
+DATA(insert (  1975   869 869 1 1201 405 ));
 /* integer_ops */
-DATA(insert (  1977   21 21 1 f        94      405 ));
-DATA(insert (  1977   23 23 1 f        96      405 ));
-DATA(insert (  1977   20 20 1 f        410 405 ));
-DATA(insert (  1977   21 23 1 f        532 405 ));
-DATA(insert (  1977   21 20 1   1862 405 ));
-DATA(insert (  1977   23 21 1 f        533 405 ));
-DATA(insert (  1977   23 20 1 f        15      405 ));
-DATA(insert (  1977   20 21 1   1868 405 ));
-DATA(insert (  1977   20 23 1 f        416 405 ));
+DATA(insert (  1977   21 21 1  94      405 ));
+DATA(insert (  1977   23 23 1  96      405 ));
+DATA(insert (  1977   20 20 1  410 405 ));
+DATA(insert (  1977   21 23 1  532 405 ));
+DATA(insert (  1977   21 20 1   1862 405 ));
+DATA(insert (  1977   23 21 1  533 405 ));
+DATA(insert (  1977   23 20 1  15      405 ));
+DATA(insert (  1977   20 21 1   1868 405 ));
+DATA(insert (  1977   20 23 1  416 405 ));
 /* interval_ops */
-DATA(insert (  1983   1186 1186 1 f 1330       405 ));
+DATA(insert (  1983   1186 1186 1 1330 405 ));
 /* macaddr_ops */
-DATA(insert (  1985   829 829 1 1220 405 ));
+DATA(insert (  1985   829 829 1 1220 405 ));
 /* name_ops */
-DATA(insert (  1987   19 19 1 f        93      405 ));
+DATA(insert (  1987   19 19 1  93      405 ));
 /* oid_ops */
-DATA(insert (  1990   26 26 1 f  607   405 ));
+DATA(insert (  1990   26 26 1  607     405 ));
 /* oidvector_ops */
-DATA(insert (  1992   30 30 1 f  649   405 ));
+DATA(insert (  1992   30 30 1  649     405 ));
 /* text_ops */
-DATA(insert (  1995   25 25 1 f        98      405 ));
+DATA(insert (  1995   25 25 1  98      405 ));
 /* time_ops */
-DATA(insert (  1997   1083 1083 1 f 1108       405 ));
+DATA(insert (  1997   1083 1083 1 1108 405 ));
 /* timestamptz_ops */
-DATA(insert (  1999   1184 1184 1 f 1320       405 ));
+DATA(insert (  1999   1184 1184 1 1320 405 ));
 /* timetz_ops */
-DATA(insert (  2001   1266 1266 1 f 1550       405 ));
+DATA(insert (  2001   1266 1266 1 1550 405 ));
 /* timestamp_ops */
-DATA(insert (  2040   1114 1114 1 f 2060       405 ));
+DATA(insert (  2040   1114 1114 1 2060 405 ));
 /* bool_ops */
-DATA(insert (  2222   16 16 1 f        91      405 ));
+DATA(insert (  2222   16 16 1  91      405 ));
 /* bytea_ops */
-DATA(insert (  2223   17 17 1 f 1955   405 ));
+DATA(insert (  2223   17 17 1 1955     405 ));
 /* int2vector_ops */
-DATA(insert (  2224   22 22 1 f  386   405 ));
+DATA(insert (  2224   22 22 1  386     405 ));
 /* xid_ops */
-DATA(insert (  2225   28 28 1 f  352   405 ));
+DATA(insert (  2225   28 28 1  352     405 ));
 /* cid_ops */
-DATA(insert (  2226   29 29 1 f  385   405 ));
+DATA(insert (  2226   29 29 1  385     405 ));
 /* abstime_ops */
-DATA(insert (  2227   702 702 1 f      560 405 ));
+DATA(insert (  2227   702 702 1        560 405 ));
 /* reltime_ops */
-DATA(insert (  2228   703 703 1 f      566 405 ));
+DATA(insert (  2228   703 703 1        566 405 ));
 /* text_pattern_ops */
-DATA(insert (  2229   25 25 1 f 2316   405 ));
+DATA(insert (  2229   25 25 1 2316     405 ));
 /* bpchar_pattern_ops */
-DATA(insert (  2231   1042 1042 1 f 2328       405 ));
+DATA(insert (  2231   1042 1042 1 2328 405 ));
 /* name_pattern_ops */
-DATA(insert (  2232   19 19 1 f 2334   405 ));
+DATA(insert (  2232   19 19 1 2334     405 ));
 /* aclitem_ops */
-DATA(insert (  2235   1033 1033 1 f  974       405 ));
+DATA(insert (  2235   1033 1033 1  974 405 ));
 /* uuid_ops */
-DATA(insert (  2969   2950 2950 1 2972 405 ));
+DATA(insert (  2969   2950 2950 1 2972 405 ));
 /* numeric_ops */
-DATA(insert (  1998   1700 1700 1 1752 405 ));
+DATA(insert (  1998   1700 1700 1 1752 405 ));
 
 
 /*
  *     gist box_ops
  */
 
-DATA(insert (  2593   603 603 1  493 783 ));
-DATA(insert (  2593   603 603 2  494 783 ));
-DATA(insert (  2593   603 603 3  500 783 ));
-DATA(insert (  2593   603 603 4  495 783 ));
-DATA(insert (  2593   603 603 5  496 783 ));
-DATA(insert (  2593   603 603 6  499 783 ));
-DATA(insert (  2593   603 603 7  498 783 ));
-DATA(insert (  2593   603 603 8  497 783 ));
-DATA(insert (  2593   603 603 9  f 2571        783 ));
-DATA(insert (  2593   603 603 10 f 2570        783 ));
-DATA(insert (  2593   603 603 11 f 2573        783 ));
-DATA(insert (  2593   603 603 12 f 2572        783 ));
-DATA(insert (  2593   603 603 13 f 2863        783 ));
-DATA(insert (  2593   603 603 14 f 2862        783 ));
+DATA(insert (  2593   603 603 1  493 783 ));
+DATA(insert (  2593   603 603 2  494 783 ));
+DATA(insert (  2593   603 603 3  500 783 ));
+DATA(insert (  2593   603 603 4  495 783 ));
+DATA(insert (  2593   603 603 5  496 783 ));
+DATA(insert (  2593   603 603 6  499 783 ));
+DATA(insert (  2593   603 603 7  498 783 ));
+DATA(insert (  2593   603 603 8  497 783 ));
+DATA(insert (  2593   603 603 9  2571  783 ));
+DATA(insert (  2593   603 603 10 2570  783 ));
+DATA(insert (  2593   603 603 11 2573  783 ));
+DATA(insert (  2593   603 603 12 2572  783 ));
+DATA(insert (  2593   603 603 13 2863  783 ));
+DATA(insert (  2593   603 603 14 2862  783 ));
 
 /*
  *     gist poly_ops (supports polygons)
  */
 
-DATA(insert (  2594   604 604 1  485 783 ));
-DATA(insert (  2594   604 604 2  486 783 ));
-DATA(insert (  2594   604 604 3  492 783 ));
-DATA(insert (  2594   604 604 4  487 783 ));
-DATA(insert (  2594   604 604 5  488 783 ));
-DATA(insert (  2594   604 604 6  491 783 ));
-DATA(insert (  2594   604 604 7  490 783 ));
-DATA(insert (  2594   604 604 8  489 783 ));
-DATA(insert (  2594   604 604 9  t 2575        783 ));
-DATA(insert (  2594   604 604 10 t 2574        783 ));
-DATA(insert (  2594   604 604 11 t 2577        783 ));
-DATA(insert (  2594   604 604 12 t 2576        783 ));
-DATA(insert (  2594   604 604 13 t 2861        783 ));
-DATA(insert (  2594   604 604 14 t 2860        783 ));
+DATA(insert (  2594   604 604 1  485 783 ));
+DATA(insert (  2594   604 604 2  486 783 ));
+DATA(insert (  2594   604 604 3  492 783 ));
+DATA(insert (  2594   604 604 4  487 783 ));
+DATA(insert (  2594   604 604 5  488 783 ));
+DATA(insert (  2594   604 604 6  491 783 ));
+DATA(insert (  2594   604 604 7  490 783 ));
+DATA(insert (  2594   604 604 8  489 783 ));
+DATA(insert (  2594   604 604 9  2575  783 ));
+DATA(insert (  2594   604 604 10 2574  783 ));
+DATA(insert (  2594   604 604 11 2577  783 ));
+DATA(insert (  2594   604 604 12 2576  783 ));
+DATA(insert (  2594   604 604 13 2861  783 ));
+DATA(insert (  2594   604 604 14 2860  783 ));
 
 /*
  *     gist circle_ops
  */
 
-DATA(insert (  2595   718 718 1  t 1506        783 ));
-DATA(insert (  2595   718 718 2  t 1507        783 ));
-DATA(insert (  2595   718 718 3  t 1513        783 ));
-DATA(insert (  2595   718 718 4  t 1508        783 ));
-DATA(insert (  2595   718 718 5  t 1509        783 ));
-DATA(insert (  2595   718 718 6  t 1512        783 ));
-DATA(insert (  2595   718 718 7  t 1511        783 ));
-DATA(insert (  2595   718 718 8  t 1510        783 ));
-DATA(insert (  2595   718 718 9  t 2589        783 ));
-DATA(insert (  2595   718 718 10 t 1515        783 ));
-DATA(insert (  2595   718 718 11 t 1514        783 ));
-DATA(insert (  2595   718 718 12 t 2590        783 ));
-DATA(insert (  2595   718 718 13 t 2865        783 ));
-DATA(insert (  2595   718 718 14 t 2864        783 ));
+DATA(insert (  2595   718 718 1  1506  783 ));
+DATA(insert (  2595   718 718 2  1507  783 ));
+DATA(insert (  2595   718 718 3  1513  783 ));
+DATA(insert (  2595   718 718 4  1508  783 ));
+DATA(insert (  2595   718 718 5  1509  783 ));
+DATA(insert (  2595   718 718 6  1512  783 ));
+DATA(insert (  2595   718 718 7  1511  783 ));
+DATA(insert (  2595   718 718 8  1510  783 ));
+DATA(insert (  2595   718 718 9  2589  783 ));
+DATA(insert (  2595   718 718 10 1515  783 ));
+DATA(insert (  2595   718 718 11 1514  783 ));
+DATA(insert (  2595   718 718 12 2590  783 ));
+DATA(insert (  2595   718 718 13 2865  783 ));
+DATA(insert (  2595   718 718 14 2864  783 ));
 
 /*
  * gin array_ops (these anyarray operators are used with all the opclasses
  * of the family)
  */
-DATA(insert (  2745   2277 2277 1      f       2750    2742 ));
-DATA(insert (  2745   2277 2277 2      f       2751    2742 ));
-DATA(insert (  2745   2277 2277 3      t       2752    2742 ));
-DATA(insert (  2745   2277 2277 4      t       1070    2742 ));
+DATA(insert (  2745   2277 2277 1      2750    2742 ));
+DATA(insert (  2745   2277 2277 2      2751    2742 ));
+DATA(insert (  2745   2277 2277 3      2752    2742 ));
+DATA(insert (  2745   2277 2277 4      1070    2742 ));
 
 /*
  * btree enum_ops
  */
-DATA(insert (  3522   3500 3500 1      f       3518    403 ));
-DATA(insert (  3522   3500 3500 2      f       3520    403 ));
-DATA(insert (  3522   3500 3500 3      f       3516    403 ));
-DATA(insert (  3522   3500 3500 4      f       3521    403 ));
-DATA(insert (  3522   3500 3500 5      f       3519    403 ));
+DATA(insert (  3522   3500 3500 1      3518    403 ));
+DATA(insert (  3522   3500 3500 2      3520    403 ));
+DATA(insert (  3522   3500 3500 3      3516    403 ));
+DATA(insert (  3522   3500 3500 4      3521    403 ));
+DATA(insert (  3522   3500 3500 5      3519    403 ));
 
 /*
  * hash enum_ops
  */
-DATA(insert (  3523   3500 3500 1      f       3516    405 ));
+DATA(insert (  3523   3500 3500 1      3516    405 ));
 
 /*
  * btree tsvector_ops
  */
-DATA(insert (  3626   3614 3614 1   3627 403 ));
-DATA(insert (  3626   3614 3614 2   3628 403 ));
-DATA(insert (  3626   3614 3614 3   3629 403 ));
-DATA(insert (  3626   3614 3614 4   3631 403 ));
-DATA(insert (  3626   3614 3614 5   3632 403 ));
+DATA(insert (  3626   3614 3614 1   3627 403 ));
+DATA(insert (  3626   3614 3614 2   3628 403 ));
+DATA(insert (  3626   3614 3614 3   3629 403 ));
+DATA(insert (  3626   3614 3614 4   3631 403 ));
+DATA(insert (  3626   3614 3614 5   3632 403 ));
 
 /*
  * GiST tsvector_ops
  */
-DATA(insert (  3655   3614 3615 1      t  3636 783 ));
+DATA(insert (  3655   3614 3615 1  3636 783 ));
 
 /*
  * GIN tsvector_ops
  */
-DATA(insert (  3659   3614 3615 1      f  3636 2742 ));
-DATA(insert (  3659   3614 3615 2      t  3660 2742 ));
+DATA(insert (  3659   3614 3615 1  3636 2742 ));
+DATA(insert (  3659   3614 3615 2  3660 2742 ));
 
 /*
  * btree tsquery_ops
  */
-DATA(insert (  3683   3615 3615 1   3674 403 ));
-DATA(insert (  3683   3615 3615 2   3675 403 ));
-DATA(insert (  3683   3615 3615 3   3676 403 ));
-DATA(insert (  3683   3615 3615 4   3678 403 ));
-DATA(insert (  3683   3615 3615 5   3679 403 ));
+DATA(insert (  3683   3615 3615 1   3674 403 ));
+DATA(insert (  3683   3615 3615 2   3675 403 ));
+DATA(insert (  3683   3615 3615 3   3676 403 ));
+DATA(insert (  3683   3615 3615 4   3678 403 ));
+DATA(insert (  3683   3615 3615 5   3679 403 ));
 
 /*
  * GiST tsquery_ops
  */
-DATA(insert (  3702   3615 3615 7      t  3693 783 ));
-DATA(insert (  3702   3615 3615 8      t  3694 783 ));
+DATA(insert (  3702   3615 3615 7  3693 783 ));
+DATA(insert (  3702   3615 3615 8  3694 783 ));
 
 #endif   /* PG_AMOP_H */
index 3a08c2cd4343d44a72925d1a283c54c246248fdf..b1c2f1c8b469afe0f64341f2be783bee14bf1384 100644 (file)
@@ -3941,7 +3941,7 @@ DATA(insert OID = 2588 (  circle_overabove                PGNSP PGUID 12 1 0 f f t f i 2  16 "7
 DESCR("overlaps or is above");
 
 /* support functions for GiST r-tree emulation */
-DATA(insert OID = 2578 (  gist_box_consistent  PGNSP PGUID 12 1 0 f f t f i 3 16 "2281 603 23" _null_ _null_ _null_    gist_box_consistent - _null_ _null_ ));
+DATA(insert OID = 2578 (  gist_box_consistent  PGNSP PGUID 12 1 0 f f t f i 5 16 "2281 603 23 26 2281" _null_ _null_ _null_    gist_box_consistent - _null_ _null_ ));
 DESCR("GiST support");
 DATA(insert OID = 2579 (  gist_box_compress            PGNSP PGUID 12 1 0 f f t f i 1 2281 "2281" _null_ _null_ _null_ gist_box_compress - _null_ _null_ ));
 DESCR("GiST support");
@@ -3955,11 +3955,11 @@ DATA(insert OID = 2583 (  gist_box_union                PGNSP PGUID 12 1 0 f f t f i 2 603 "22
 DESCR("GiST support");
 DATA(insert OID = 2584 (  gist_box_same                        PGNSP PGUID 12 1 0 f f t f i 3 2281 "603 603 2281" _null_ _null_ _null_ gist_box_same - _null_ _null_ ));
 DESCR("GiST support");
-DATA(insert OID = 2585 (  gist_poly_consistent PGNSP PGUID 12 1 0 f f t f i 3 16 "2281 604 23" _null_ _null_ _null_    gist_poly_consistent - _null_ _null_ ));
+DATA(insert OID = 2585 (  gist_poly_consistent PGNSP PGUID 12 1 0 f f t f i 5 16 "2281 604 23 26 2281" _null_ _null_ _null_    gist_poly_consistent - _null_ _null_ ));
 DESCR("GiST support");
 DATA(insert OID = 2586 (  gist_poly_compress   PGNSP PGUID 12 1 0 f f t f i 1 2281 "2281" _null_ _null_ _null_ gist_poly_compress - _null_ _null_ ));
 DESCR("GiST support");
-DATA(insert OID = 2591 (  gist_circle_consistent PGNSP PGUID 12 1 0 f f t f i 3 16 "2281 718 23" _null_ _null_ _null_  gist_circle_consistent - _null_ _null_ ));
+DATA(insert OID = 2591 (  gist_circle_consistent PGNSP PGUID 12 1 0 f f t f i 5 16 "2281 718 23 26 2281" _null_ _null_ _null_  gist_circle_consistent - _null_ _null_ ));
 DESCR("GiST support");
 DATA(insert OID = 2592 (  gist_circle_compress PGNSP PGUID 12 1 0 f f t f i 1 2281 "2281" _null_ _null_ _null_ gist_circle_compress - _null_ _null_ ));
 DESCR("GiST support");
@@ -3997,7 +3997,7 @@ DATA(insert OID = 2743 (  ginarrayextract  PGNSP PGUID 12 1 0 f f t f i 2 2281 "
 DESCR("GIN array support");
 DATA(insert OID = 2774 (  ginqueryarrayextract PGNSP PGUID 12 1 0 f f t f i 3 2281 "2277 2281 21" _null_ _null_ _null_ ginqueryarrayextract - _null_ _null_ ));
 DESCR("GIN array support");
-DATA(insert OID = 2744 (  ginarrayconsistent PGNSP PGUID 12 1 0 f f t f i 3 16 "2281 21 2281" _null_ _null_ _null_     ginarrayconsistent - _null_ _null_ ));
+DATA(insert OID = 2744 (  ginarrayconsistent PGNSP PGUID 12 1 0 f f t f i 4 16 "2281 21 2281 2281" _null_ _null_ _null_        ginarrayconsistent - _null_ _null_ ));
 DESCR("GIN array support");
 
 /* overlap/contains/contained */
@@ -4225,14 +4225,14 @@ DATA(insert OID = 3652 (  gtsvector_same                PGNSP PGUID 12 1 0 f f t f i 3 2281 "3
 DESCR("GiST tsvector support");
 DATA(insert OID = 3653 (  gtsvector_penalty            PGNSP PGUID 12 1 0 f f t f i 3 2281 "2281 2281 2281" _null_ _null_ _null_ gtsvector_penalty - _null_ _null_ ));
 DESCR("GiST tsvector support");
-DATA(insert OID = 3654 (  gtsvector_consistent PGNSP PGUID 12 1 0 f f t f i 3 16 "3642 2281 23" _null_ _null_ _null_ gtsvector_consistent - _null_ _null_ ));
+DATA(insert OID = 3654 (  gtsvector_consistent PGNSP PGUID 12 1 0 f f t f i 5 16 "2281 3642 23 26 2281" _null_ _null_ _null_ gtsvector_consistent - _null_ _null_ ));
 DESCR("GiST tsvector support");
 
 DATA(insert OID = 3656 (  gin_extract_tsvector PGNSP PGUID 12 1 0 f f t f i 2 2281 "3614 2281" _null_ _null_ _null_    gin_extract_tsvector - _null_ _null_ ));
 DESCR("GIN tsvector support");
 DATA(insert OID = 3657 (  gin_extract_tsquery  PGNSP PGUID 12 1 0 f f t f i 3 2281 "3615 2281 21" _null_ _null_ _null_ gin_extract_tsquery - _null_ _null_ ));
 DESCR("GIN tsvector support");
-DATA(insert OID = 3658 (  gin_tsquery_consistent PGNSP PGUID 12 1 0 f f t f i 3 16 "2281 21 3615" _null_ _null_ _null_ gin_tsquery_consistent - _null_ _null_ ));
+DATA(insert OID = 3658 (  gin_tsquery_consistent PGNSP PGUID 12 1 0 f f t f i 4 16 "2281 21 3615 2281" _null_ _null_ _null_    gin_tsquery_consistent - _null_ _null_ ));
 DESCR("GIN tsvector support");
 
 DATA(insert OID = 3662 (  tsquery_lt                   PGNSP PGUID 12 1 0 f f t f i 2 16 "3615 3615" _null_ _null_ _null_ tsquery_lt - _null_ _null_ ));
@@ -4284,7 +4284,7 @@ DATA(insert OID = 3699 (  gtsquery_same                                   PGNSP PGUID 12 1 0 f f t f i 3 2281
 DESCR("GiST tsquery support");
 DATA(insert OID = 3700 (  gtsquery_penalty                             PGNSP PGUID 12 1 0 f f t f i 3 2281 "2281 2281 2281" _null_ _null_ _null_ gtsquery_penalty - _null_ _null_ ));
 DESCR("GiST tsquery support");
-DATA(insert OID = 3701 (  gtsquery_consistent                  PGNSP PGUID 12 1 0 f f t f i 3 16 "20 2281 23" _null_ _null_ _null_ gtsquery_consistent - _null_ _null_ ));
+DATA(insert OID = 3701 (  gtsquery_consistent                  PGNSP PGUID 12 1 0 f f t f i 5 16 "2281 2281 23 26 2281" _null_ _null_ _null_ gtsquery_consistent - _null_ _null_ ));
 DESCR("GiST tsquery support");
 
 DATA(insert OID = 3689 (  ts_stat              PGNSP PGUID 12 10 10000 f f t t v 1 2249 "25" "{25,25,23,23}" "{i,o,o,o}" "{query,word,ndoc,nentry}" ts_stat1 - _null_ _null_ ));
index f786f1878893df5818f2fd938786926cebef7c7e..04f805d6edfec1cf1f6f41bced2a2e68ffb52a41 100644 (file)
@@ -1390,7 +1390,6 @@ typedef struct CreateOpClassItem
        List       *name;                       /* operator or function name */
        List       *args;                       /* argument types */
        int                     number;                 /* strategy num or support proc num */
-       bool            recheck;                /* only used for operators */
        List       *class_args;         /* only used for functions */
        /* fields used for a storagetype item: */
        TypeName   *storedtype;         /* datatype stored in index */