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 0dc7cb9329708bae044574d28ab477b62fd2395c..f9007cb92c47a781b465fc78afc8b496d40ddf7d 100644 (file)
@@ -1,4 +1,4 @@
-/* $PostgreSQL: pgsql/contrib/btree_gist/btree_gist.sql.in,v 1.19 2007/11/13 04:24:27 momjian Exp $ */
+/* $PostgreSQL: pgsql/contrib/btree_gist/btree_gist.sql.in,v 1.20 2008/04/14 17:05:31 tgl Exp $ */
 
 -- Adjust this setting to control where the objects get created.
 SET search_path = public;
@@ -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 aee0edd40260e62e467decf036a3c7fbfb35b786..9e71819e1aa93e3bdea9362794be77ad4ef9bd8d 100644 (file)
@@ -1,4 +1,4 @@
-/* $PostgreSQL: pgsql/contrib/btree_gist/uninstall_btree_gist.sql,v 1.4 2007/11/13 04:24:27 momjian Exp $ */
+/* $PostgreSQL: pgsql/contrib/btree_gist/uninstall_btree_gist.sql,v 1.5 2008/04/14 17:05:32 tgl Exp $ */
 
 -- Adjust this setting to control where the objects get dropped.
 SET search_path = public;
@@ -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 c57b9919c48db35234a17ff7ec5b779ee519d764..2aa9177516d5ed0fc9ab7d6d71899c11326e439d 100644 (file)
@@ -1,5 +1,5 @@
 /******************************************************************************
-  $PostgreSQL: pgsql/contrib/cube/cube.c,v 1.34 2007/11/15 21:14:29 momjian Exp $
+  $PostgreSQL: pgsql/contrib/cube/cube.c,v 1.35 2008/04/14 17:05:32 tgl Exp $
 
   This file contains routines that can be bound to a Postgres backend and
   called by the backend in the process of processing queries.  The calling
@@ -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 7756e16de2f2875cc502101fccc2b59de6162639..cd3713d323b77abdc4607ca888fb469b375398b0 100644 (file)
@@ -1,4 +1,4 @@
-/* $PostgreSQL: pgsql/contrib/cube/cube.sql.in,v 1.23 2007/11/13 04:24:27 momjian Exp $ */
+/* $PostgreSQL: pgsql/contrib/cube/cube.sql.in,v 1.24 2008/04/14 17:05:32 tgl Exp $ */
 
 -- Adjust this setting to control where the objects get created.
 SET search_path = public;
@@ -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 fa78a061f56e2899249ba738f213a2d6b4f409c3..abdb5a2db344142b5ce2314985bc96c56a6f6a51 100644 (file)
@@ -1,4 +1,4 @@
-/* $PostgreSQL: pgsql/contrib/cube/uninstall_cube.sql,v 1.7 2007/11/13 04:24:27 momjian Exp $ */
+/* $PostgreSQL: pgsql/contrib/cube/uninstall_cube.sql,v 1.8 2008/04/14 17:05:32 tgl Exp $ */
 
 -- Adjust this setting to control where the objects get dropped.
 SET search_path = public;
@@ -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 fb39967866c6f794ad174c495b402b89b8b57568..1b22ff63c560f53d222cc72a4b9a6951bb1a5964 100644 (file)
@@ -1,4 +1,4 @@
-/* $PostgreSQL: pgsql/contrib/hstore/hstore.sql.in,v 1.8 2007/11/13 04:24:28 momjian Exp $ */
+/* $PostgreSQL: pgsql/contrib/hstore/hstore.sql.in,v 1.9 2008/04/14 17:05:32 tgl Exp $ */
 
 -- Adjust this setting to control where the objects get created.
 SET search_path = public;
@@ -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 d9e08927a5ef81eedc0f1a19d4d9d62b0814df6a..84d567fcadf87496e71a11a8cc47d428909a8288 100644 (file)
@@ -1,4 +1,4 @@
-/* $PostgreSQL: pgsql/contrib/hstore/uninstall_hstore.sql,v 1.6 2007/11/13 04:24:28 momjian Exp $ */
+/* $PostgreSQL: pgsql/contrib/hstore/uninstall_hstore.sql,v 1.7 2008/04/14 17:05:32 tgl Exp $ */
 
 -- Adjust this setting to control where the objects get dropped.
 SET search_path = public;
@@ -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 9753f14fbf32bdb0d0ed2cea09e7133cd59c0b68..c681626dc9b57d496562b8bf8e33e528c0585c5e 100644 (file)
@@ -1,4 +1,4 @@
-/* $PostgreSQL: pgsql/contrib/intarray/_int.sql.in,v 1.27 2007/11/13 04:24:28 momjian Exp $ */
+/* $PostgreSQL: pgsql/contrib/intarray/_int.sql.in,v 1.28 2008/04/14 17:05:32 tgl Exp $ */
 
 -- Adjust this setting to control where the objects get created.
 SET search_path = public;
@@ -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 9ef269ec21cf34942337001a5ff764a987e90518..59ef2afc0f09d115684a8732cfe5649125ce24d5 100644 (file)
@@ -1,4 +1,4 @@
-/* $PostgreSQL: pgsql/contrib/intarray/uninstall__int.sql,v 1.8 2007/11/13 04:24:28 momjian Exp $ */
+/* $PostgreSQL: pgsql/contrib/intarray/uninstall__int.sql,v 1.9 2008/04/14 17:05:32 tgl Exp $ */
 
 -- Adjust this setting to control where the objects get created.
 SET search_path = public;
@@ -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 1d7c288fc743e24cde4b1a2ba5589feb182ce5ee..4d378823ca0f5ec429f7947cd092c7f67383acf0 100644 (file)
@@ -1,4 +1,4 @@
-/* $PostgreSQL: pgsql/contrib/ltree/ltree.sql.in,v 1.16 2007/11/13 04:24:28 momjian Exp $ */
+/* $PostgreSQL: pgsql/contrib/ltree/ltree.sql.in,v 1.17 2008/04/14 17:05:32 tgl Exp $ */
 
 -- Adjust this setting to control where the objects get created.
 SET search_path = public;
@@ -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 dea0b9c3863ab35de53ad519d0f31f7554b1a5de..17c44b93aac06f1951014985968029f6c52b0fc9 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * GiST support for ltree
  * Teodor Sigaev <teodor@stack.net>
- * $PostgreSQL: pgsql/contrib/ltree/ltree_gist.c,v 1.22 2007/11/16 01:12:24 momjian Exp $
+ * $PostgreSQL: pgsql/contrib/ltree/ltree_gist.c,v 1.23 2008/04/14 17:05:32 tgl Exp $
  */
 
 #include "ltree.h"
@@ -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 4d976839a4a547d8315760d2c41be29ac995f1d0..acd07df1e8ac3b3c276152e38f95595311e5e7ce 100644 (file)
@@ -1,4 +1,4 @@
-/* $PostgreSQL: pgsql/contrib/ltree/uninstall_ltree.sql,v 1.5 2007/11/13 04:24:28 momjian Exp $ */
+/* $PostgreSQL: pgsql/contrib/ltree/uninstall_ltree.sql,v 1.6 2008/04/14 17:05:32 tgl Exp $ */
 
 -- Adjust this setting to control where the objects get dropped.
 SET search_path = public;
@@ -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 963e6f091df3e9372524f8cc50f226e340db4dbd..d65a9cf6b2ec1d6aa11f5632930fb91ba32ecc20 100644 (file)
@@ -1,4 +1,4 @@
-/* $PostgreSQL: pgsql/contrib/pg_trgm/pg_trgm.sql.in,v 1.7 2007/12/09 02:22:46 tgl Exp $ */
+/* $PostgreSQL: pgsql/contrib/pg_trgm/pg_trgm.sql.in,v 1.8 2008/04/14 17:05:32 tgl Exp $ */
 
 -- Adjust this setting to control where the objects get created.
 SET search_path = public;
@@ -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 907b884b4e7df4d600c48ec4d67044fd3614f7c4..094dfcddc733e2487c7ef1ee605814c4e4d1be72 100644 (file)
@@ -1,4 +1,4 @@
-/* $PostgreSQL: pgsql/contrib/pg_trgm/uninstall_pg_trgm.sql,v 1.5 2007/11/13 04:24:28 momjian Exp $ */
+/* $PostgreSQL: pgsql/contrib/pg_trgm/uninstall_pg_trgm.sql,v 1.6 2008/04/14 17:05:32 tgl Exp $ */
 
 -- Adjust this setting to control where the objects get dropped.
 SET search_path = public;
@@ -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 7a8b9dc9c703ac23d47f67dbeefa0c520a6d53fd..6f7d1a6438a2af28e5d8633c52813d074f6cf3b2 100644 (file)
@@ -1,4 +1,4 @@
-/* $PostgreSQL: pgsql/contrib/seg/seg.sql.in,v 1.16 2007/11/13 04:24:28 momjian Exp $ */
+/* $PostgreSQL: pgsql/contrib/seg/seg.sql.in,v 1.17 2008/04/14 17:05:32 tgl Exp $ */
 
 -- Adjust this setting to control where the objects get created.
 SET search_path = public;
@@ -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 5237ff81cb3584e6afecfe0b4f4071be59b47465..2822927531db915d712de985552175cde717b7c1 100644 (file)
@@ -1,4 +1,4 @@
-/* $PostgreSQL: pgsql/contrib/seg/uninstall_seg.sql,v 1.5 2007/11/13 04:24:28 momjian Exp $ */
+/* $PostgreSQL: pgsql/contrib/seg/uninstall_seg.sql,v 1.6 2008/04/14 17:05:32 tgl Exp $ */
 
 -- Adjust this setting to control where the objects get dropped.
 SET search_path = public;
@@ -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 13f22d6adfdfdaa828035f55bb01e866e6b1e29e..3a6f21614f17345a2afabdbc91591bef39345675 100644 (file)
@@ -1,4 +1,4 @@
-/* $PostgreSQL: pgsql/contrib/tsearch2/tsearch2.sql.in,v 1.4 2007/11/28 19:33:04 tgl Exp $ */
+/* $PostgreSQL: pgsql/contrib/tsearch2/tsearch2.sql.in,v 1.5 2008/04/14 17:05:32 tgl Exp $ */
 
 -- Adjust this setting to control where the objects get created.
 SET search_path = public;
@@ -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 a6aaa4fd5a8519c01c069259de1d70b3ef0d5e08..f43c46908c0add7622ed37b56fc3f64ecf000e7d 100644 (file)
@@ -1,4 +1,4 @@
-<!-- $PostgreSQL: pgsql/doc/src/sgml/catalogs.sgml,v 2.164 2008/04/10 22:25:25 tgl Exp $ -->
+<!-- $PostgreSQL: pgsql/doc/src/sgml/catalogs.sgml,v 2.165 2008/04/14 17:05:32 tgl Exp $ -->
 <!--
  Documentation of the system catalogs, directed toward PostgreSQL developers
  -->
       <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 c15de7b1c9ec64e5d4fd5d932f9dd060046c467b..d2af5e63ee87bb0ddac47cfbdb977acdf13ad2fd 100644 (file)
@@ -1,4 +1,4 @@
-<!-- $PostgreSQL: pgsql/doc/src/sgml/func.sgml,v 1.429 2008/04/10 13:34:33 alvherre Exp $ -->
+<!-- $PostgreSQL: pgsql/doc/src/sgml/func.sgml,v 1.430 2008/04/14 17:05:32 tgl Exp $ -->
 
  <chapter id="functions">
   <title>Functions and Operators</title>
@@ -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 1b7f105ac569e9a40b9e447a3dac3b5ab427e471..ad82da6b38e7b28787ffe8ab46ec9ffe556e111f 100644 (file)
@@ -1,4 +1,4 @@
-<!-- $PostgreSQL: pgsql/doc/src/sgml/gin.sgml,v 2.13 2007/11/16 03:23:07 tgl Exp $ -->
+<!-- $PostgreSQL: pgsql/doc/src/sgml/gin.sgml,v 2.14 2008/04/14 17:05:32 tgl Exp $ -->
 
 <chapter id="GIN">
 <title>GIN Indexes</title>
     </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 587517da1d17ce13b54f998accb6d871e2da2d3b..f236e6ad614f5172ba386081a87c67669f617b92 100644 (file)
@@ -1,4 +1,4 @@
-<!-- $PostgreSQL: pgsql/doc/src/sgml/gist.sgml,v 1.29 2007/11/13 23:36:26 tgl Exp $ -->
+<!-- $PostgreSQL: pgsql/doc/src/sgml/gist.sgml,v 1.30 2008/04/14 17:05:32 tgl Exp $ -->
 
 <chapter id="GiST">
 <title>GiST Indexes</title>
        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 1b42ff0231aa265a2d07d7e8422236cf6c54f567..760d8d1a206da059f88b0beb84e36b962f212485 100644 (file)
@@ -1,4 +1,4 @@
-<!-- $PostgreSQL: pgsql/doc/src/sgml/indexam.sgml,v 2.25 2008/04/13 19:18:13 tgl Exp $ -->
+<!-- $PostgreSQL: pgsql/doc/src/sgml/indexam.sgml,v 2.26 2008/04/14 17:05:32 tgl Exp $ -->
 
 <chapter id="indexam">
  <title>Index Access Method Interface Definition</title>
@@ -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 cbb1c7b27860f5aa1502d5621ab0a84e6fd2220a..5ebd27507caa377fc31493ca3c87b743be9be272 100644 (file)
@@ -1,5 +1,5 @@
 <!--
-$PostgreSQL: pgsql/doc/src/sgml/ref/alter_opfamily.sgml,v 1.3 2007/02/14 04:30:26 tgl Exp $
+$PostgreSQL: pgsql/doc/src/sgml/ref/alter_opfamily.sgml,v 1.4 2008/04/14 17:05:32 tgl Exp $
 PostgreSQL documentation
 -->
 
@@ -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 366922cc6248ff617caac5449e86238e3228fa9c..c6a911b6d9239903e5a6c0066d7410ad58e9f2da 100644 (file)
@@ -1,5 +1,5 @@
 <!--
-$PostgreSQL: pgsql/doc/src/sgml/ref/create_opclass.sgml,v 1.21 2007/12/03 23:49:51 tgl Exp $
+$PostgreSQL: pgsql/doc/src/sgml/ref/create_opclass.sgml,v 1.22 2008/04/14 17:05:32 tgl Exp $
 PostgreSQL documentation
 -->
 
@@ -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 1aec17efd97f0b4eea55ce5516651923d0cb9f9e..caa8847ef8e6bf78ff5a5b00fc7069a063ca2f29 100644 (file)
@@ -1,4 +1,4 @@
-<!-- $PostgreSQL: pgsql/doc/src/sgml/textsearch.sgml,v 1.42 2008/03/10 03:01:28 tgl Exp $ -->
+<!-- $PostgreSQL: pgsql/doc/src/sgml/textsearch.sgml,v 1.43 2008/04/14 17:05:32 tgl Exp $ -->
 
 <chapter id="textsearch">
  <title id="textsearch-title">Full Text Search</title>
@@ -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 68d3123ef853919b70122c37d1d063e8ceb6980b..6bf7535b636300bcc4581f0a54320d3e8424e03c 100644 (file)
@@ -1,4 +1,4 @@
-<!-- $PostgreSQL: pgsql/doc/src/sgml/xindex.sgml,v 1.61 2007/12/02 04:36:40 tgl Exp $ -->
+<!-- $PostgreSQL: pgsql/doc/src/sgml/xindex.sgml,v 1.62 2008/04/14 17:05:32 tgl Exp $ -->
 
 <sect1 id="xindex">
  <title>Interfacing Extensions To Indexes</title>
@@ -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 c453cda525cb80d85000d0de895ad5c5454ecb50..c85399d632f0ec42002a0647393e9e7449453825 100644 (file)
@@ -8,7 +8,7 @@
  * Portions Copyright (c) 1994, Regents of the University of California
  *
  * IDENTIFICATION
- *   $PostgreSQL: pgsql/src/backend/access/gin/ginarrayproc.c,v 1.12 2008/01/01 19:45:46 momjian Exp $
+ *   $PostgreSQL: pgsql/src/backend/access/gin/ginarrayproc.c,v 1.13 2008/04/14 17:05:33 tgl Exp $
  *-------------------------------------------------------------------------
  */
 #include "postgres.h"
@@ -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 af38717340ad821c2cbbca4f5c28ccd3d7d96a84..26abaa76afaaf621cef2be495d97b46a2e0c6ec8 100644 (file)
@@ -8,7 +8,7 @@
  * Portions Copyright (c) 1994, Regents of the University of California
  *
  * IDENTIFICATION
- *         $PostgreSQL: pgsql/src/backend/access/gin/ginget.c,v 1.12 2008/04/13 19:18:13 tgl Exp $
+ *         $PostgreSQL: pgsql/src/backend/access/gin/ginget.c,v 1.13 2008/04/14 17:05:33 tgl Exp $
  *-------------------------------------------------------------------------
  */
 
@@ -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 8e92139582599480298676e7a8b868edda139c22..7a5177218e5eebfe2edcd4b041bb310839efbe81 100644 (file)
@@ -8,7 +8,7 @@
  * Portions Copyright (c) 1994, Regents of the University of California
  *
  * IDENTIFICATION
- *   $PostgreSQL: pgsql/src/backend/access/gist/gistget.c,v 1.71 2008/04/13 19:18:14 tgl Exp $
+ *   $PostgreSQL: pgsql/src/backend/access/gist/gistget.c,v 1.72 2008/04/14 17:05:33 tgl Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -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 7653776c36523a17f00c1f7b45edea77ef03d06b..ec23385f5c97299081826b0e5737956452e911ab 100644 (file)
@@ -10,7 +10,7 @@
  * Portions Copyright (c) 1994, Regents of the University of California
  *
  * IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/access/gist/gistproc.c,v 1.13 2008/01/01 19:45:46 momjian Exp $
+ * $PostgreSQL: pgsql/src/backend/access/gist/gistproc.c,v 1.14 2008/04/14 17:05:33 tgl Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -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 648488a04ae43208d4dcdf6d5f309e9c12664a08..08bb97288d4add527e97401f0a62071647999736 100644 (file)
@@ -9,7 +9,7 @@
  *
  *
  * IDENTIFICATION
- *   $PostgreSQL: pgsql/src/backend/commands/opclasscmds.c,v 1.59 2008/03/26 21:10:37 alvherre Exp $
+ *   $PostgreSQL: pgsql/src/backend/commands/opclasscmds.c,v 1.60 2008/04/14 17:05:33 tgl Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -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 e1e8957efd7b8a522cbb98e01ce719d5912dae3b..87a04bcd64c99a7cb14f13dba7c291cddd5b71ae 100644 (file)
@@ -15,7 +15,7 @@
  * Portions Copyright (c) 1994, Regents of the University of California
  *
  * IDENTIFICATION
- *   $PostgreSQL: pgsql/src/backend/nodes/copyfuncs.c,v 1.391 2008/04/13 20:51:20 tgl Exp $
+ *   $PostgreSQL: pgsql/src/backend/nodes/copyfuncs.c,v 1.392 2008/04/14 17:05:33 tgl Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -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 fd453fabd23c27f804cbb5a57132712669afb18f..161e8f06dcf01c9f4a35d61d8063e1ea7b09e8be 100644 (file)
@@ -18,7 +18,7 @@
  * Portions Copyright (c) 1994, Regents of the University of California
  *
  * IDENTIFICATION
- *   $PostgreSQL: pgsql/src/backend/nodes/equalfuncs.c,v 1.320 2008/03/21 22:41:48 tgl Exp $
+ *   $PostgreSQL: pgsql/src/backend/nodes/equalfuncs.c,v 1.321 2008/04/14 17:05:33 tgl Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -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 21fff239c70abea9e3ea77732e97b0e96f0ae23a..e17842231d9e18c8b80e92778ec5a80c0f1344e4 100644 (file)
@@ -11,7 +11,7 @@
  *
  *
  * IDENTIFICATION
- *   $PostgreSQL: pgsql/src/backend/parser/gram.y,v 2.611 2008/03/28 00:21:55 tgl Exp $
+ *   $PostgreSQL: pgsql/src/backend/parser/gram.y,v 2.612 2008/04/14 17:05:33 tgl Exp $
  *
  * HISTORY
  *   AUTHOR            DATE            MAJOR EVENT
@@ -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 add1fc1910c7a7eb926961069834462b514be336..55518834ae97a8df2e144d40f0dba625ee787d9e 100644 (file)
@@ -7,7 +7,7 @@
  *
  *
  * IDENTIFICATION
- *   $PostgreSQL: pgsql/src/backend/utils/adt/tsginidx.c,v 1.10 2008/03/25 22:42:44 tgl Exp $
+ *   $PostgreSQL: pgsql/src/backend/utils/adt/tsginidx.c,v 1.11 2008/04/14 17:05:33 tgl Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -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 f3a98ba6f8d3f3f9b14f8f02f95733fc12e04f8b..ecbac7b40f23c2ae4918ed97f69dce788a8976cb 100644 (file)
@@ -7,7 +7,7 @@
  *
  *
  * IDENTIFICATION
- *   $PostgreSQL: pgsql/src/backend/utils/adt/tsgistidx.c,v 1.7 2008/01/01 19:45:52 momjian Exp $
+ *   $PostgreSQL: pgsql/src/backend/utils/adt/tsgistidx.c,v 1.8 2008/04/14 17:05:33 tgl Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -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 fdefd92bae244dbcc62a9a4cd8eec010b78aebdc..df813b592232832f2e5c20592ef25a529e38d303 100644 (file)
@@ -7,7 +7,7 @@
  *
  *
  * IDENTIFICATION
- *   $PostgreSQL: pgsql/src/backend/utils/adt/tsquery_gist.c,v 1.4 2008/01/01 19:45:53 momjian Exp $
+ *   $PostgreSQL: pgsql/src/backend/utils/adt/tsquery_gist.c,v 1.5 2008/04/14 17:05:33 tgl Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -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 d32048d0ec707709f8a0ca6223c353bedf1bfc2a..dbc3a191b5e8926dcd9414e6372e5ab48d248288 100644 (file)
@@ -12,7 +12,7 @@
  * by PostgreSQL
  *
  * IDENTIFICATION
- *   $PostgreSQL: pgsql/src/bin/pg_dump/pg_dump.c,v 1.487 2008/04/13 03:49:22 tgl Exp $
+ *   $PostgreSQL: pgsql/src/bin/pg_dump/pg_dump.c,v 1.488 2008/04/14 17:05:33 tgl Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -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 a0b1a34f29cfeeb30c97235a16b0375ba67d558a..f80d918c656ab63ff1825ea565eccc2a73d79bcd 100644 (file)
@@ -37,7 +37,7 @@
  * Portions Copyright (c) 1996-2008, PostgreSQL Global Development Group
  * Portions Copyright (c) 1994, Regents of the University of California
  *
- * $PostgreSQL: pgsql/src/include/catalog/catversion.h,v 1.447 2008/04/10 22:25:25 tgl Exp $
+ * $PostgreSQL: pgsql/src/include/catalog/catversion.h,v 1.448 2008/04/14 17:05:33 tgl Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -53,6 +53,6 @@
  */
 
 /*                         yyyymmddN */
-#define CATALOG_VERSION_NO 200804101
+#define CATALOG_VERSION_NO 200804141
 
 #endif
index cc211232fab493192dbcc442d7878428b3eb8734..e48fe1546130178bf4008ae0dab471de7ae4156a 100644 (file)
@@ -29,7 +29,7 @@
  * Portions Copyright (c) 1996-2008, PostgreSQL Global Development Group
  * Portions Copyright (c) 1994, Regents of the University of California
  *
- * $PostgreSQL: pgsql/src/include/catalog/pg_amop.h,v 1.85 2008/03/27 03:57:34 tgl Exp $
+ * $PostgreSQL: pgsql/src/include/catalog/pg_amop.h,v 1.86 2008/04/14 17:05:33 tgl Exp $
  *
  * NOTES
  *  the genbki.sh script reads this file and generates .bki
@@ -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 7ef852666be8cd5039135d45acfbf33c5144d33c..6eefea9491a283ccd02d2f0cb42f04c08b781f98 100644 (file)
@@ -7,7 +7,7 @@
  * Portions Copyright (c) 1996-2008, PostgreSQL Global Development Group
  * Portions Copyright (c) 1994, Regents of the University of California
  *
- * $PostgreSQL: pgsql/src/include/catalog/pg_proc.h,v 1.488 2008/04/10 22:25:25 tgl Exp $
+ * $PostgreSQL: pgsql/src/include/catalog/pg_proc.h,v 1.489 2008/04/14 17:05:33 tgl Exp $
  *
  * NOTES
  *   The script catalog/genbki.sh reads this file and generates .bki
@@ -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 ce96f25ab0bac928a45376434bffc4f9d09162d3..2463125626954f63887c0a239af6fa5e571045e3 100644 (file)
@@ -7,7 +7,7 @@
  * Portions Copyright (c) 1996-2008, PostgreSQL Global Development Group
  * Portions Copyright (c) 1994, Regents of the University of California
  *
- * $PostgreSQL: pgsql/src/include/nodes/parsenodes.h,v 1.361 2008/03/21 22:41:48 tgl Exp $
+ * $PostgreSQL: pgsql/src/include/nodes/parsenodes.h,v 1.362 2008/04/14 17:05:34 tgl Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -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 */