diff --git a/contrib/btree_gist/btree_bit.c b/contrib/btree_gist/btree_bit.c index 534c9af813..d86034fd6f 100644 --- a/contrib/btree_gist/btree_bit.c +++ b/contrib/btree_gist/btree_bit.c @@ -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 diff --git a/contrib/btree_gist/btree_bytea.c b/contrib/btree_gist/btree_bytea.c index d5345872d6..02229653f4 100644 --- a/contrib/btree_gist/btree_bytea.c +++ b/contrib/btree_gist/btree_bytea.c @@ -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); } diff --git a/contrib/btree_gist/btree_cash.c b/contrib/btree_gist/btree_cash.c index 13f8200fb7..eb618754d9 100644 --- a/contrib/btree_gist/btree_cash.c +++ b/contrib/btree_gist/btree_cash.c @@ -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; diff --git a/contrib/btree_gist/btree_date.c b/contrib/btree_gist/btree_date.c index b14888889d..212ee2d397 100644 --- a/contrib/btree_gist/btree_date.c +++ b/contrib/btree_gist/btree_date.c @@ -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; diff --git a/contrib/btree_gist/btree_float4.c b/contrib/btree_gist/btree_float4.c index a4c941f835..1aab392b80 100644 --- a/contrib/btree_gist/btree_float4.c +++ b/contrib/btree_gist/btree_float4.c @@ -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; diff --git a/contrib/btree_gist/btree_float8.c b/contrib/btree_gist/btree_float8.c index 1b87b4ee1b..3c804922cc 100644 --- a/contrib/btree_gist/btree_float8.c +++ b/contrib/btree_gist/btree_float8.c @@ -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; diff --git a/contrib/btree_gist/btree_gist.sql.in b/contrib/btree_gist/btree_gist.sql.in index 0dc7cb9329..f9007cb92c 100644 --- a/contrib/btree_gist/btree_gist.sql.in +++ b/contrib/btree_gist/btree_gist.sql.in @@ -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), diff --git a/contrib/btree_gist/btree_inet.c b/contrib/btree_gist/btree_inet.c index 914f4f6d5e..b54e1c112f 100644 --- a/contrib/btree_gist/btree_inet.c +++ b/contrib/btree_gist/btree_inet.c @@ -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; diff --git a/contrib/btree_gist/btree_int2.c b/contrib/btree_gist/btree_int2.c index 5e2a66526e..b129130c2c 100644 --- a/contrib/btree_gist/btree_int2.c +++ b/contrib/btree_gist/btree_int2.c @@ -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; diff --git a/contrib/btree_gist/btree_int4.c b/contrib/btree_gist/btree_int4.c index 6a69b85bdd..c07c9a1e2c 100644 --- a/contrib/btree_gist/btree_int4.c +++ b/contrib/btree_gist/btree_int4.c @@ -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; diff --git a/contrib/btree_gist/btree_int8.c b/contrib/btree_gist/btree_int8.c index 83275f2c7a..3466e1c115 100644 --- a/contrib/btree_gist/btree_int8.c +++ b/contrib/btree_gist/btree_int8.c @@ -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; diff --git a/contrib/btree_gist/btree_interval.c b/contrib/btree_gist/btree_interval.c index 09c6be5487..232ba20531 100644 --- a/contrib/btree_gist/btree_interval.c +++ b/contrib/btree_gist/btree_interval.c @@ -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; diff --git a/contrib/btree_gist/btree_macaddr.c b/contrib/btree_gist/btree_macaddr.c index 52cf4cb1d4..5bdc9eb3bd 100644 --- a/contrib/btree_gist/btree_macaddr.c +++ b/contrib/btree_gist/btree_macaddr.c @@ -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; diff --git a/contrib/btree_gist/btree_numeric.c b/contrib/btree_gist/btree_numeric.c index 639b575cb3..a1fcf602c0 100644 --- a/contrib/btree_gist/btree_numeric.c +++ b/contrib/btree_gist/btree_numeric.c @@ -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); } diff --git a/contrib/btree_gist/btree_oid.c b/contrib/btree_gist/btree_oid.c index 979d728a73..119035cad6 100644 --- a/contrib/btree_gist/btree_oid.c +++ b/contrib/btree_gist/btree_oid.c @@ -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; diff --git a/contrib/btree_gist/btree_text.c b/contrib/btree_gist/btree_text.c index fa4eb904f5..7951d055d3 100644 --- a/contrib/btree_gist/btree_text.c +++ b/contrib/btree_gist/btree_text.c @@ -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) { diff --git a/contrib/btree_gist/btree_time.c b/contrib/btree_gist/btree_time.c index fd5e63e2bb..6c1ec80a31 100644 --- a/contrib/btree_gist/btree_time.c +++ b/contrib/btree_gist/btree_time.c @@ -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 diff --git a/contrib/btree_gist/btree_ts.c b/contrib/btree_gist/btree_ts.c index 9a7d650527..606a986a70 100644 --- a/contrib/btree_gist/btree_ts.c +++ b/contrib/btree_gist/btree_ts.c @@ -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); diff --git a/contrib/btree_gist/uninstall_btree_gist.sql b/contrib/btree_gist/uninstall_btree_gist.sql index aee0edd402..9e71819e1a 100644 --- a/contrib/btree_gist/uninstall_btree_gist.sql +++ b/contrib/btree_gist/uninstall_btree_gist.sql @@ -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; diff --git a/contrib/cube/cube.c b/contrib/cube/cube.c index c57b9919c4..2aa9177516 100644 --- a/contrib/cube/cube.c +++ b/contrib/cube/cube.c @@ -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 diff --git a/contrib/cube/cube.sql.in b/contrib/cube/cube.sql.in index 7756e16de2..cd3713d323 100644 --- a/contrib/cube/cube.sql.in +++ b/contrib/cube/cube.sql.in @@ -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), diff --git a/contrib/cube/uninstall_cube.sql b/contrib/cube/uninstall_cube.sql index fa78a061f5..abdb5a2db3 100644 --- a/contrib/cube/uninstall_cube.sql +++ b/contrib/cube/uninstall_cube.sql @@ -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); diff --git a/contrib/hstore/hstore.sql.in b/contrib/hstore/hstore.sql.in index fb39967866..1b22ff63c5 100644 --- a/contrib/hstore/hstore.sql.in +++ b/contrib/hstore/hstore.sql.in @@ -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; diff --git a/contrib/hstore/hstore_gin.c b/contrib/hstore/hstore_gin.c index 144758f3cd..aec25b2b65 100644 --- a/contrib/hstore/hstore_gin.c +++ b/contrib/hstore/hstore_gin.c @@ -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); diff --git a/contrib/hstore/hstore_gist.c b/contrib/hstore/hstore_gist.c index aa3aa0d94b..15ac965991 100644 --- a/contrib/hstore/hstore_gist.c +++ b/contrib/hstore/hstore_gist.c @@ -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); diff --git a/contrib/hstore/uninstall_hstore.sql b/contrib/hstore/uninstall_hstore.sql index d9e08927a5..84d567fcad 100644 --- a/contrib/hstore/uninstall_hstore.sql +++ b/contrib/hstore/uninstall_hstore.sql @@ -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); diff --git a/contrib/intarray/_int.sql.in b/contrib/intarray/_int.sql.in index 9753f14fbf..c681626dc9 100644 --- a/contrib/intarray/_int.sql.in +++ b/contrib/intarray/_int.sql.in @@ -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; diff --git a/contrib/intarray/_int_gin.c b/contrib/intarray/_int_gin.c index 6856a68e03..8b6e99edae 100644 --- a/contrib/intarray/_int_gin.c +++ b/contrib/intarray/_int_gin.c @@ -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: - case RTContainsStrategyNumber: - case RTOldContainsStrategyNumber: - res = TRUE; - do { 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; } - } while (0); + } + break; + case RTContainsStrategyNumber: + case RTOldContainsStrategyNumber: + { + 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; + } + } 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); diff --git a/contrib/intarray/_int_gist.c b/contrib/intarray/_int_gist.c index abd576223e..37c05784b9 100644 --- a/contrib/intarray/_int_gist.c +++ b/contrib/intarray/_int_gist.c @@ -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, diff --git a/contrib/intarray/_intbig_gist.c b/contrib/intarray/_intbig_gist.c index 3bfbc84dc7..b96c6d7289 100644 --- a/contrib/intarray/_intbig_gist.c +++ b/contrib/intarray/_intbig_gist.c @@ -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); diff --git a/contrib/intarray/uninstall__int.sql b/contrib/intarray/uninstall__int.sql index 9ef269ec21..59ef2afc0f 100644 --- a/contrib/intarray/uninstall__int.sql +++ b/contrib/intarray/uninstall__int.sql @@ -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); diff --git a/contrib/ltree/_ltree_gist.c b/contrib/ltree/_ltree_gist.c index 34ec2552ca..1c9b6b03ea 100644 --- a/contrib/ltree/_ltree_gist.c +++ b/contrib/ltree/_ltree_gist.c @@ -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: diff --git a/contrib/ltree/ltree.sql.in b/contrib/ltree/ltree.sql.in index 1d7c288fc7..4d378823ca 100644 --- a/contrib/ltree/ltree.sql.in +++ b/contrib/ltree/ltree.sql.in @@ -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), diff --git a/contrib/ltree/ltree_gist.c b/contrib/ltree/ltree_gist.c index dea0b9c386..17c44b93aa 100644 --- a/contrib/ltree/ltree_gist.c +++ b/contrib/ltree/ltree_gist.c @@ -1,7 +1,7 @@ /* * GiST support for ltree * Teodor Sigaev - * $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: diff --git a/contrib/ltree/uninstall_ltree.sql b/contrib/ltree/uninstall_ltree.sql index 4d976839a4..acd07df1e8 100644 --- a/contrib/ltree/uninstall_ltree.sql +++ b/contrib/ltree/uninstall_ltree.sql @@ -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; diff --git a/contrib/pg_trgm/pg_trgm.sql.in b/contrib/pg_trgm/pg_trgm.sql.in index 963e6f091d..d65a9cf6b2 100644 --- a/contrib/pg_trgm/pg_trgm.sql.in +++ b/contrib/pg_trgm/pg_trgm.sql.in @@ -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; diff --git a/contrib/pg_trgm/trgm_gin.c b/contrib/pg_trgm/trgm_gin.c index 33d005ae9a..9a36afa074 100644 --- a/contrib/pg_trgm/trgm_gin.c +++ b/contrib/pg_trgm/trgm_gin.c @@ -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); diff --git a/contrib/pg_trgm/trgm_gist.c b/contrib/pg_trgm/trgm_gist.c index 4286928d34..9cf88dc45b 100644 --- a/contrib/pg_trgm/trgm_gist.c +++ b/contrib/pg_trgm/trgm_gist.c @@ -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; - if (GIST_LEAF((GISTENTRY *) PG_GETARG_POINTER(0))) + /* All cases served by this function are exact */ + *recheck = false; + + if (GIST_LEAF(entry)) { /* all leafs contains orig trgm */ float4 tmpsml = cnt_sml(key, qtrg); diff --git a/contrib/pg_trgm/uninstall_pg_trgm.sql b/contrib/pg_trgm/uninstall_pg_trgm.sql index 907b884b4e..094dfcddc7 100644 --- a/contrib/pg_trgm/uninstall_pg_trgm.sql +++ b/contrib/pg_trgm/uninstall_pg_trgm.sql @@ -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); diff --git a/contrib/seg/seg.c b/contrib/seg/seg.c index aea8676556..65ddda1671 100644 --- a/contrib/seg/seg.c +++ b/contrib/seg/seg.c @@ -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 diff --git a/contrib/seg/seg.sql.in b/contrib/seg/seg.sql.in index 7a8b9dc9c7..6f7d1a6438 100644 --- a/contrib/seg/seg.sql.in +++ b/contrib/seg/seg.sql.in @@ -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), diff --git a/contrib/seg/uninstall_seg.sql b/contrib/seg/uninstall_seg.sql index 5237ff81cb..2822927531 100644 --- a/contrib/seg/uninstall_seg.sql +++ b/contrib/seg/uninstall_seg.sql @@ -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); diff --git a/contrib/tsearch2/tsearch2.sql.in b/contrib/tsearch2/tsearch2.sql.in index 13f22d6adf..3a6f21614f 100644 --- a/contrib/tsearch2/tsearch2.sql.in +++ b/contrib/tsearch2/tsearch2.sql.in @@ -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 diff --git a/doc/src/sgml/catalogs.sgml b/doc/src/sgml/catalogs.sgml index a6aaa4fd5a..f43c46908c 100644 --- a/doc/src/sgml/catalogs.sgml +++ b/doc/src/sgml/catalogs.sgml @@ -1,4 +1,4 @@ - + @@ -606,13 +606,6 @@ Operator strategy number - - amopreqcheck - bool - - Index hit must be rechecked - - amopopr oid diff --git a/doc/src/sgml/func.sgml b/doc/src/sgml/func.sgml index c15de7b1c9..d2af5e63ee 100644 --- a/doc/src/sgml/func.sgml +++ b/doc/src/sgml/func.sgml @@ -1,4 +1,4 @@ - + Functions and Operators @@ -7738,7 +7738,7 @@ CREATE TYPE rainbow AS ENUM ('red', 'orange', 'yellow', 'green', 'blue', 'purple @@@ - same as @@, but see + deprecated synonym for @@ to_tsvector('fat cats ate rats') @@@ to_tsquery('cat & rat') t diff --git a/doc/src/sgml/gin.sgml b/doc/src/sgml/gin.sgml index 1b7f105ac5..ad82da6b38 100644 --- a/doc/src/sgml/gin.sgml +++ b/doc/src/sgml/gin.sgml @@ -1,4 +1,4 @@ - + GIN Indexes @@ -111,12 +111,12 @@ - bool consistent(bool check[], StrategyNumber n, Datum query) + bool consistent(bool check[], StrategyNumber n, Datum query, bool *recheck) Returns TRUE if the indexed value satisfies the query operator with - strategy number n (or would satisfy, if the operator is - marked RECHECK in the operator class). The check array has + strategy number n (or might satisfy, if the recheck + indication is returned). The check array has the same length as the number of keys previously returned by extractQuery for this query. Each element of the check array is TRUE if the indexed value contains the @@ -124,6 +124,9 @@ extractQuery result array is present in the indexed value. The original query datum (not the extracted key array!) is passed in case the consistent method needs to consult it. + On success, *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. diff --git a/doc/src/sgml/gist.sgml b/doc/src/sgml/gist.sgml index 587517da1d..f236e6ad61 100644 --- a/doc/src/sgml/gist.sgml +++ b/doc/src/sgml/gist.sgml @@ -1,4 +1,4 @@ - + GiST Indexes @@ -103,7 +103,10 @@ Given a predicate p on a tree page, and a user query, q, this method will return false if it is certain that both p and q cannot - be true for a given data item. + be true for a given data item. For a true result, a + recheck flag must also be returned; this indicates whether + the predicate implies the query (recheck = false) or + not (recheck = true). diff --git a/doc/src/sgml/indexam.sgml b/doc/src/sgml/indexam.sgml index 1b42ff0231..760d8d1a20 100644 --- a/doc/src/sgml/indexam.sgml +++ b/doc/src/sgml/indexam.sgml @@ -1,4 +1,4 @@ - + Index Access Method Interface Definition @@ -183,7 +183,7 @@ aminsert (Relation indexRelation, parameter. See 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.) @@ -430,13 +430,13 @@ amrestrpos (IndexScanDesc scan); - The operator family can indicate that the index is 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 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. @@ -849,7 +849,7 @@ amcostestimate (PlannerInfo *root, 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. diff --git a/doc/src/sgml/ref/alter_opfamily.sgml b/doc/src/sgml/ref/alter_opfamily.sgml index cbb1c7b278..5ebd27507c 100644 --- a/doc/src/sgml/ref/alter_opfamily.sgml +++ b/doc/src/sgml/ref/alter_opfamily.sgml @@ -1,5 +1,5 @@ @@ -21,7 +21,7 @@ PostgreSQL documentation ALTER OPERATOR FAMILY name USING index_method ADD - { OPERATOR strategy_number operator_name ( op_type, op_type ) [ RECHECK ] + { OPERATOR strategy_number operator_name ( op_type, op_type ) | FUNCTION support_number [ ( op_type [ , op_type ] ) ] funcname ( argument_type [, ...] ) } [, ... ] ALTER OPERATOR FAMILY name USING index_method DROP @@ -154,18 +154,6 @@ ALTER OPERATOR FAMILY name USING support_number @@ -247,6 +235,14 @@ ALTER OPERATOR FAMILY name USING name [ DEFAULT ] FOR TYPE data_type USING index_method [ FAMILY family_name ] AS - { OPERATOR strategy_number operator_name [ ( op_type, op_type ) ] [ RECHECK ] + { OPERATOR strategy_number operator_name [ ( op_type, op_type ) ] | FUNCTION support_number [ ( op_type [ , op_type ] ) ] funcname ( argument_type [, ...] ) | STORAGE storage_type } [, ... ] @@ -179,18 +179,6 @@ CREATE OPERATOR CLASS name [ DEFAUL - - RECHECK - - - If present, the index is 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. - - - - support_number @@ -256,6 +244,14 @@ CREATE OPERATOR CLASS name [ DEFAUL is likely to be inlined into the calling query, which will prevent the optimizer from recognizing that the query matches an index. + + + Before PostgreSQL 8.4, the OPERATOR + clause could include a RECHECK option. This is no longer + supported because whether an index operator is lossy is now + determined on-the-fly at runtime. This allows efficient handling of + cases where an operator might or might not be lossy. + @@ -271,12 +267,12 @@ CREATE OPERATOR CLASS name [ DEFAUL CREATE OPERATOR CLASS gist__int_ops DEFAULT FOR TYPE _int4 USING gist AS OPERATOR 3 &&, - OPERATOR 6 = RECHECK, + OPERATOR 6 = (anyarray, anyarray), OPERATOR 7 @>, OPERATOR 8 <@, 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), diff --git a/doc/src/sgml/textsearch.sgml b/doc/src/sgml/textsearch.sgml index 1aec17efd9..caa8847ef8 100644 --- a/doc/src/sgml/textsearch.sgml +++ b/doc/src/sgml/textsearch.sgml @@ -1,4 +1,4 @@ - + Full Text Search @@ -3142,19 +3142,7 @@ SELECT plainto_tsquery('supernovae stars'); A GiST index is lossy, meaning that the index may produce false matches, and it is necessary to check the actual table row to eliminate such false matches. - PostgreSQL does this automatically; for - example, in the query plan below, the Filter: - line indicates the index output will be rechecked: - - -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) - - + (PostgreSQL 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'); - GIN indexes are not lossy but their performance depends logarithmically on - the number of unique words. - - - - Actually, GIN indexes store only the words (lexemes) of 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 - 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: - - - - - - The standard text match operator @@ is marked as non-lossy - for GIN indexes. - - - - - - An additional match operator @@@ is provided, and marked - as lossy for GIN indexes. This operator behaves exactly like - @@ otherwise. - - - - - - When a GIN index search is initiated with the @@ 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. - - - - - - In short, you must use @@@ rather than @@ to - perform GIN index searches on queries that involve weight restrictions. - For queries that do not have weight restrictions, either operator will - work, but @@ will be faster. - This awkwardness will probably be addressed in a future release of - 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 tsvector + values, and not their weight labels. Thus a table row recheck is needed + when using a query that involves weights.) diff --git a/doc/src/sgml/xindex.sgml b/doc/src/sgml/xindex.sgml index 68d3123ef8..6bf7535b63 100644 --- a/doc/src/sgml/xindex.sgml +++ b/doc/src/sgml/xindex.sgml @@ -1,4 +1,4 @@ - + Interfacing Extensions To Indexes @@ -913,26 +913,31 @@ ALTER OPERATOR FAMILY integer_ops USING btree ADD 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 WHERE condition using the operator. For example: SELECT * FROM table WHERE integer_column < 4; 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 WHERE + the matching rows. For example, if a GiST index stores only bounding boxes + for geometric objects, then it cannot exactly satisfy a 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 lossy for the - operator, and we add RECHECK to the OPERATOR clause - in the CREATE OPERATOR CLASS command. - 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 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. diff --git a/src/backend/access/gin/ginarrayproc.c b/src/backend/access/gin/ginarrayproc.c index c453cda525..c85399d632 100644 --- a/src/backend/access/gin/ginarrayproc.c +++ b/src/backend/access/gin/ginarrayproc.c @@ -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: - case GinContainedStrategy: + /* result is not lossy */ + *recheck = false; /* at least one element in check[] is true, so result = true */ - res = 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; break; case GinContainsStrategy: - case GinEqualStrategy: + /* result is not lossy */ + *recheck = false; + /* 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; + 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; + for (i = 0; i < nentries; i++) + { + if (!check[i]) + { + res = false; + break; + } + } break; default: elog(ERROR, "ginarrayconsistent: unknown strategy number: %d", strategy); - res = FALSE; + res = false; } PG_RETURN_BOOL(res); diff --git a/src/backend/access/gin/ginget.c b/src/backend/access/gin/ginget.c index af38717340..26abaa76af 100644 --- a/src/backend/access/gin/ginget.c +++ b/src/backend/access/gin/ginget.c @@ -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; + uint32 i; + bool keyrecheck; - /* XXX for the moment, treat all GIN operators as lossy */ - *recheck = true; + /* + * 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 */ diff --git a/src/backend/access/gist/gistget.c b/src/backend/access/gist/gistget.c index 8e92139582..7a5177218e 100644 --- a/src/backend/access/gist/gistget.c +++ b/src/backend/access/gist/gistget.c @@ -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 diff --git a/src/backend/access/gist/gistproc.c b/src/backend/access/gist/gistproc.c index 7653776c36..ec23385f5c 100644 --- a/src/backend/access/gist/gistproc.c +++ b/src/backend/access/gist/gistproc.c @@ -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.) */ diff --git a/src/backend/commands/opclasscmds.c b/src/backend/commands/opclasscmds.c index 648488a04a..08bb97288d 100644 --- a/src/backend/commands/opclasscmds.c +++ b/src/backend/commands/opclasscmds.c @@ -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); diff --git a/src/backend/nodes/copyfuncs.c b/src/backend/nodes/copyfuncs.c index e1e8957efd..87a04bcd64 100644 --- a/src/backend/nodes/copyfuncs.c +++ b/src/backend/nodes/copyfuncs.c @@ -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); diff --git a/src/backend/nodes/equalfuncs.c b/src/backend/nodes/equalfuncs.c index fd453fabd2..161e8f06dc 100644 --- a/src/backend/nodes/equalfuncs.c +++ b/src/backend/nodes/equalfuncs.c @@ -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); diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index 21fff239c7..e17842231d 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -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; } ; diff --git a/src/backend/utils/adt/tsginidx.c b/src/backend/utils/adt/tsginidx.c index add1fc1910..55518834ae 100644 --- a/src/backend/utils/adt/tsginidx.c +++ b/src/backend/utils/adt/tsginidx.c @@ -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) diff --git a/src/backend/utils/adt/tsgistidx.c b/src/backend/utils/adt/tsgistidx.c index f3a98ba6f8..ecbac7b40f 100644 --- a/src/backend/utils/adt/tsgistidx.c +++ b/src/backend/utils/adt/tsgistidx.c @@ -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); diff --git a/src/backend/utils/adt/tsquery_gist.c b/src/backend/utils/adt/tsquery_gist.c index fdefd92bae..df813b5922 100644 --- a/src/backend/utils/adt/tsquery_gist.c +++ b/src/backend/utils/adt/tsquery_gist.c @@ -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: diff --git a/src/bin/pg_dump/pg_dump.c b/src/bin/pg_dump/pg_dump.c index d32048d0ec..dbc3a191b5 100644 --- a/src/bin/pg_dump/pg_dump.c +++ b/src/bin/pg_dump/pg_dump.c @@ -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,14 @@ 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 " @@ -7658,6 +7685,19 @@ dumpOpfamily(Archive *fout, OpfamilyInfo *opfinfo) "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 " + "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); + } res_ops = PQexec(g_conn, query->data); check_sql_result(res_ops, g_conn, query->data, PGRES_TUPLES_OK); diff --git a/src/include/catalog/catversion.h b/src/include/catalog/catversion.h index a0b1a34f29..f80d918c65 100644 --- a/src/include/catalog/catversion.h +++ b/src/include/catalog/catversion.h @@ -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 diff --git a/src/include/catalog/pg_amop.h b/src/include/catalog/pg_amop.h index cc211232fa..e48fe15461 100644 --- a/src/include/catalog/pg_amop.h +++ b/src/include/catalog/pg_amop.h @@ -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 f 1222 403 )); -DATA(insert ( 1984 829 829 2 f 1223 403 )); -DATA(insert ( 1984 829 829 3 f 1220 403 )); -DATA(insert ( 1984 829 829 4 f 1225 403 )); -DATA(insert ( 1984 829 829 5 f 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 f 1203 403 )); -DATA(insert ( 1974 869 869 2 f 1204 403 )); -DATA(insert ( 1974 869 869 3 f 1201 403 )); -DATA(insert ( 1974 869 869 4 f 1206 403 )); -DATA(insert ( 1974 869 869 5 f 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 f 1120 405 )); -DATA(insert ( 1971 701 700 1 f 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 f 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 f 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 f 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 f 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 f 2972 405 )); +DATA(insert ( 2969 2950 2950 1 2972 405 )); /* numeric_ops */ -DATA(insert ( 1998 1700 1700 1 f 1752 405 )); +DATA(insert ( 1998 1700 1700 1 1752 405 )); /* * gist box_ops */ -DATA(insert ( 2593 603 603 1 f 493 783 )); -DATA(insert ( 2593 603 603 2 f 494 783 )); -DATA(insert ( 2593 603 603 3 f 500 783 )); -DATA(insert ( 2593 603 603 4 f 495 783 )); -DATA(insert ( 2593 603 603 5 f 496 783 )); -DATA(insert ( 2593 603 603 6 f 499 783 )); -DATA(insert ( 2593 603 603 7 f 498 783 )); -DATA(insert ( 2593 603 603 8 f 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 t 485 783 )); -DATA(insert ( 2594 604 604 2 t 486 783 )); -DATA(insert ( 2594 604 604 3 t 492 783 )); -DATA(insert ( 2594 604 604 4 t 487 783 )); -DATA(insert ( 2594 604 604 5 t 488 783 )); -DATA(insert ( 2594 604 604 6 t 491 783 )); -DATA(insert ( 2594 604 604 7 t 490 783 )); -DATA(insert ( 2594 604 604 8 t 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 f 3627 403 )); -DATA(insert ( 3626 3614 3614 2 f 3628 403 )); -DATA(insert ( 3626 3614 3614 3 f 3629 403 )); -DATA(insert ( 3626 3614 3614 4 f 3631 403 )); -DATA(insert ( 3626 3614 3614 5 f 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 f 3674 403 )); -DATA(insert ( 3683 3615 3615 2 f 3675 403 )); -DATA(insert ( 3683 3615 3615 3 f 3676 403 )); -DATA(insert ( 3683 3615 3615 4 f 3678 403 )); -DATA(insert ( 3683 3615 3615 5 f 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 */ diff --git a/src/include/catalog/pg_proc.h b/src/include/catalog/pg_proc.h index 7ef852666b..6eefea9491 100644 --- a/src/include/catalog/pg_proc.h +++ b/src/include/catalog/pg_proc.h @@ -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_ )); diff --git a/src/include/nodes/parsenodes.h b/src/include/nodes/parsenodes.h index ce96f25ab0..2463125626 100644 --- a/src/include/nodes/parsenodes.h +++ b/src/include/nodes/parsenodes.h @@ -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 */