diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2009-03-25 22:19:02 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2009-03-25 22:19:02 +0000 |
commit | 87b8db37740bb044cb3b6a6439e656217869fd57 (patch) | |
tree | c59eb0167c37ed34b9b24e718b2357bec48dcce1 /contrib/intarray | |
parent | 050a78dd3da8d3711197bda429ed7733bbf1b291 (diff) | |
download | postgresql-87b8db37740bb044cb3b6a6439e656217869fd57.tar.gz |
Adjust the APIs for GIN opclass support functions to allow the extractQuery()
method to pass extra data to the consistent() and comparePartial() methods.
This is the core infrastructure needed to support the soon-to-appear
contrib/btree_gin module. The APIs are still upward compatible with the
definitions used in 8.3 and before, although *not* with the previous 8.4devel
function definitions.
catversion bump for changes in pg_proc entries (although these are just
cosmetic, since GIN doesn't actually look at the function signature before
calling it...)
Teodor Sigaev and Oleg Bartunov
Diffstat (limited to 'contrib/intarray')
-rw-r--r-- | contrib/intarray/_int.sql.in | 12 | ||||
-rw-r--r-- | contrib/intarray/_int_gin.c | 6 | ||||
-rw-r--r-- | contrib/intarray/uninstall__int.sql | 6 |
3 files changed, 13 insertions, 11 deletions
diff --git a/contrib/intarray/_int.sql.in b/contrib/intarray/_int.sql.in index c681626dc9..9f91a65eec 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.28 2008/04/14 17:05:32 tgl Exp $ */ +/* $PostgreSQL: pgsql/contrib/intarray/_int.sql.in,v 1.29 2009/03/25 22:19:01 tgl Exp $ */ -- Adjust this setting to control where the objects get created. SET search_path = public; @@ -458,13 +458,13 @@ AS --GIN -CREATE OR REPLACE FUNCTION ginint4_queryextract(internal, internal, int2) +CREATE OR REPLACE FUNCTION ginint4_queryextract(internal, internal, int2, internal, internal) RETURNS internal AS 'MODULE_PATHNAME' LANGUAGE C IMMUTABLE; -CREATE OR REPLACE FUNCTION ginint4_consistent(internal, int2, internal, internal) -RETURNS internal +CREATE OR REPLACE FUNCTION ginint4_consistent(internal, int2, internal, int4, internal, internal) +RETURNS bool AS 'MODULE_PATHNAME' LANGUAGE C IMMUTABLE; @@ -480,6 +480,6 @@ AS 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, internal), + FUNCTION 3 ginint4_queryextract (internal, internal, int2, internal, internal), + FUNCTION 4 ginint4_consistent (internal, int2, internal, int4, internal, internal), STORAGE int4; diff --git a/contrib/intarray/_int_gin.c b/contrib/intarray/_int_gin.c index 0edb686df2..598cdeca57 100644 --- a/contrib/intarray/_int_gin.c +++ b/contrib/intarray/_int_gin.c @@ -1,5 +1,5 @@ /* - * $PostgreSQL: pgsql/contrib/intarray/_int_gin.c,v 1.8 2008/05/17 01:28:19 adunstan Exp $ + * $PostgreSQL: pgsql/contrib/intarray/_int_gin.c,v 1.9 2009/03/25 22:19:01 tgl Exp $ */ #include "postgres.h" @@ -90,7 +90,9 @@ ginint4_consistent(PG_FUNCTION_ARGS) { bool *check = (bool *) PG_GETARG_POINTER(0); StrategyNumber strategy = PG_GETARG_UINT16(1); - bool *recheck = (bool *) PG_GETARG_POINTER(3); + /* int32 nkeys = PG_GETARG_INT32(3); */ + /* Pointer *extra_data = (Pointer *) PG_GETARG_POINTER(4); */ + bool *recheck = (bool *) PG_GETARG_POINTER(5); bool res = FALSE; /* diff --git a/contrib/intarray/uninstall__int.sql b/contrib/intarray/uninstall__int.sql index 59ef2afc0f..5346bddc75 100644 --- a/contrib/intarray/uninstall__int.sql +++ b/contrib/intarray/uninstall__int.sql @@ -1,13 +1,13 @@ -/* $PostgreSQL: pgsql/contrib/intarray/uninstall__int.sql,v 1.9 2008/04/14 17:05:32 tgl Exp $ */ +/* $PostgreSQL: pgsql/contrib/intarray/uninstall__int.sql,v 1.10 2009/03/25 22:19:01 tgl Exp $ */ -- Adjust this setting to control where the objects get created. SET search_path = public; DROP OPERATOR CLASS gin__int_ops USING gin; -DROP FUNCTION ginint4_queryextract(internal, internal, int2); +DROP FUNCTION ginint4_queryextract(internal, internal, int2, internal, internal); -DROP FUNCTION ginint4_consistent(internal, int2, internal, internal); +DROP FUNCTION ginint4_consistent(internal, int2, internal, int4, internal, internal); DROP OPERATOR CLASS gist__intbig_ops USING gist; |