mirror of https://github.com/postgres/postgres
Add backwards-compatible declarations of some core GIN support functions.
These are needed to support reloading dumps of 9.0 installations containing contrib/intarray or contrib/tsearch2. Since not only regular dump/reload but binary upgrade would fail, it seems worth the trouble to carry these stubs for awhile. Note that the contrib opclasses referencing these functions will still work fine, since GIN doesn't actually pay any attention to the declared signature of a support function.
This commit is contained in:
parent
b15fabf997
commit
6595dd04d1
|
@ -65,7 +65,10 @@ ALTER EXTENSION intarray ADD function g_intbig_union(internal,internal);
|
|||
ALTER EXTENSION intarray ADD function g_intbig_same(internal,internal,internal);
|
||||
ALTER EXTENSION intarray ADD operator family gist__intbig_ops using gist;
|
||||
ALTER EXTENSION intarray ADD operator class gist__intbig_ops using gist;
|
||||
ALTER EXTENSION intarray ADD function ginint4_queryextract(internal,internal,smallint,internal,internal,internal,internal);
|
||||
ALTER EXTENSION intarray ADD function ginint4_consistent(internal,smallint,internal,integer,internal,internal,internal,internal);
|
||||
ALTER EXTENSION intarray ADD operator family gin__int_ops using gin;
|
||||
ALTER EXTENSION intarray ADD operator class gin__int_ops using gin;
|
||||
|
||||
-- these two functions have different signatures in 9.1, but we don't
|
||||
-- bother trying to fix them because GIN doesn't care much
|
||||
ALTER EXTENSION intarray ADD function ginint4_queryextract(internal,internal,smallint,internal,internal);
|
||||
ALTER EXTENSION intarray ADD function ginint4_consistent(internal,smallint,internal,integer,internal,internal);
|
||||
|
|
|
@ -58,6 +58,20 @@ ginarrayextract(PG_FUNCTION_ARGS)
|
|||
PG_RETURN_POINTER(elems);
|
||||
}
|
||||
|
||||
/*
|
||||
* Formerly, ginarrayextract had only two arguments. Now it has three,
|
||||
* but we still need a pg_proc entry with two args to support reloading
|
||||
* pre-9.1 contrib/intarray opclass declarations. This compatibility
|
||||
* function should go away eventually.
|
||||
*/
|
||||
Datum
|
||||
ginarrayextract_2args(PG_FUNCTION_ARGS)
|
||||
{
|
||||
if (PG_NARGS() < 3) /* should not happen */
|
||||
elog(ERROR, "ginarrayextract requires three arguments");
|
||||
return ginarrayextract(fcinfo);
|
||||
}
|
||||
|
||||
/*
|
||||
* extractQuery support function
|
||||
*/
|
||||
|
|
|
@ -230,3 +230,43 @@ gin_tsquery_consistent(PG_FUNCTION_ARGS)
|
|||
|
||||
PG_RETURN_BOOL(res);
|
||||
}
|
||||
|
||||
/*
|
||||
* Formerly, gin_extract_tsvector had only two arguments. Now it has three,
|
||||
* but we still need a pg_proc entry with two args to support reloading
|
||||
* pre-9.1 contrib/tsearch2 opclass declarations. This compatibility
|
||||
* function should go away eventually. (Note: you might say "hey, but the
|
||||
* code above is only *using* two args, so let's just declare it that way".
|
||||
* If you try that you'll find the opr_sanity regression test complains.)
|
||||
*/
|
||||
Datum
|
||||
gin_extract_tsvector_2args(PG_FUNCTION_ARGS)
|
||||
{
|
||||
if (PG_NARGS() < 3) /* should not happen */
|
||||
elog(ERROR, "gin_extract_tsvector requires three arguments");
|
||||
return gin_extract_tsvector(fcinfo);
|
||||
}
|
||||
|
||||
/*
|
||||
* Likewise, we need a stub version of gin_extract_tsquery declared with
|
||||
* only five arguments.
|
||||
*/
|
||||
Datum
|
||||
gin_extract_tsquery_5args(PG_FUNCTION_ARGS)
|
||||
{
|
||||
if (PG_NARGS() < 7) /* should not happen */
|
||||
elog(ERROR, "gin_extract_tsquery requires seven arguments");
|
||||
return gin_extract_tsquery(fcinfo);
|
||||
}
|
||||
|
||||
/*
|
||||
* Likewise, we need a stub version of gin_tsquery_consistent declared with
|
||||
* only six arguments.
|
||||
*/
|
||||
Datum
|
||||
gin_tsquery_consistent_6args(PG_FUNCTION_ARGS)
|
||||
{
|
||||
if (PG_NARGS() < 8) /* should not happen */
|
||||
elog(ERROR, "gin_tsquery_consistent requires eight arguments");
|
||||
return gin_tsquery_consistent(fcinfo);
|
||||
}
|
||||
|
|
|
@ -53,6 +53,6 @@
|
|||
*/
|
||||
|
||||
/* yyyymmddN */
|
||||
#define CATALOG_VERSION_NO 201102141
|
||||
#define CATALOG_VERSION_NO 201102161
|
||||
|
||||
#endif
|
||||
|
|
|
@ -4407,6 +4407,8 @@ DATA(insert OID = 2774 ( ginqueryarrayextract PGNSP PGUID 12 1 0 0 f f f t f i
|
|||
DESCR("GIN array support");
|
||||
DATA(insert OID = 2744 ( ginarrayconsistent PGNSP PGUID 12 1 0 0 f f f t f i 8 0 16 "2281 21 2277 23 2281 2281 2281 2281" _null_ _null_ _null_ _null_ ginarrayconsistent _null_ _null_ _null_ ));
|
||||
DESCR("GIN array support");
|
||||
DATA(insert OID = 3076 ( ginarrayextract PGNSP PGUID 12 1 0 0 f f f t f i 2 0 2281 "2277 2281" _null_ _null_ _null_ _null_ ginarrayextract_2args _null_ _null_ _null_ ));
|
||||
DESCR("GIN array support (obsolete)");
|
||||
|
||||
/* overlap/contains/contained */
|
||||
DATA(insert OID = 2747 ( arrayoverlap PGNSP PGUID 12 1 0 0 f f f t f i 2 0 16 "2277 2277" _null_ _null_ _null_ _null_ arrayoverlap _null_ _null_ _null_ ));
|
||||
|
@ -4666,6 +4668,12 @@ DATA(insert OID = 3724 ( gin_cmp_tslexeme PGNSP PGUID 12 1 0 0 f f f t f i 2 0
|
|||
DESCR("GIN tsvector support");
|
||||
DATA(insert OID = 2700 ( gin_cmp_prefix PGNSP PGUID 12 1 0 0 f f f t f i 4 0 23 "25 25 21 2281" _null_ _null_ _null_ _null_ gin_cmp_prefix _null_ _null_ _null_ ));
|
||||
DESCR("GIN tsvector support");
|
||||
DATA(insert OID = 3077 ( gin_extract_tsvector PGNSP PGUID 12 1 0 0 f f f t f i 2 0 2281 "3614 2281" _null_ _null_ _null_ _null_ gin_extract_tsvector_2args _null_ _null_ _null_ ));
|
||||
DESCR("GIN tsvector support (obsolete)");
|
||||
DATA(insert OID = 3087 ( gin_extract_tsquery PGNSP PGUID 12 1 0 0 f f f t f i 5 0 2281 "3615 2281 21 2281 2281" _null_ _null_ _null_ _null_ gin_extract_tsquery_5args _null_ _null_ _null_ ));
|
||||
DESCR("GIN tsvector support (obsolete)");
|
||||
DATA(insert OID = 3088 ( gin_tsquery_consistent PGNSP PGUID 12 1 0 0 f f f t f i 6 0 16 "2281 21 3615 23 2281 2281" _null_ _null_ _null_ _null_ gin_tsquery_consistent_6args _null_ _null_ _null_ ));
|
||||
DESCR("GIN tsvector support (obsolete)");
|
||||
|
||||
DATA(insert OID = 3662 ( tsquery_lt PGNSP PGUID 12 1 0 0 f f f t f i 2 0 16 "3615 3615" _null_ _null_ _null_ _null_ tsquery_lt _null_ _null_ _null_ ));
|
||||
DESCR("less-than");
|
||||
|
|
|
@ -149,6 +149,9 @@ extern Datum gin_cmp_tslexeme(PG_FUNCTION_ARGS);
|
|||
extern Datum gin_cmp_prefix(PG_FUNCTION_ARGS);
|
||||
extern Datum gin_extract_tsquery(PG_FUNCTION_ARGS);
|
||||
extern Datum gin_tsquery_consistent(PG_FUNCTION_ARGS);
|
||||
extern Datum gin_extract_tsvector_2args(PG_FUNCTION_ARGS);
|
||||
extern Datum gin_extract_tsquery_5args(PG_FUNCTION_ARGS);
|
||||
extern Datum gin_tsquery_consistent_6args(PG_FUNCTION_ARGS);
|
||||
|
||||
/*
|
||||
* Possible strategy numbers for indexes
|
||||
|
|
|
@ -1053,6 +1053,7 @@ extern Datum window_nth_value(PG_FUNCTION_ARGS);
|
|||
|
||||
/* access/gin/ginarrayproc.c */
|
||||
extern Datum ginarrayextract(PG_FUNCTION_ARGS);
|
||||
extern Datum ginarrayextract_2args(PG_FUNCTION_ARGS);
|
||||
extern Datum ginqueryarrayextract(PG_FUNCTION_ARGS);
|
||||
extern Datum ginarrayconsistent(PG_FUNCTION_ARGS);
|
||||
|
||||
|
|
Loading…
Reference in New Issue