Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commiteb43e85

Browse files
committed
Create stub functions to support pg_upgrade of old contrib/tsearch2.
Commits9ff6027 anddbe2328 adjusted the declarationsof some core functions referenced by contrib/tsearch2's install script,forgetting that in a pg_upgrade situation, we'll be trying to restoreoperator class definitions that reference the old signatures. We'vehit this problem before; solve it in the same way as before, namely byinstalling stub functions that have the expected signature and justinvoke the correct function. Per report from Jeff Janes.(Someday we ought to stop supporting contrib/tsearch2, but I'm notsure today is that day.)
1 parentcc6077d commiteb43e85

File tree

6 files changed

+60
-1
lines changed

6 files changed

+60
-1
lines changed

‎src/backend/utils/adt/tsginidx.c

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -377,3 +377,23 @@ gin_tsquery_consistent_6args(PG_FUNCTION_ARGS)
377377
elog(ERROR,"gin_tsquery_consistent requires eight arguments");
378378
returngin_tsquery_consistent(fcinfo);
379379
}
380+
381+
/*
382+
* Likewise, a stub version of gin_extract_tsquery declared with argument
383+
* types that are no longer considered appropriate.
384+
*/
385+
Datum
386+
gin_extract_tsquery_oldsig(PG_FUNCTION_ARGS)
387+
{
388+
returngin_extract_tsquery(fcinfo);
389+
}
390+
391+
/*
392+
* Likewise, a stub version of gin_tsquery_consistent declared with argument
393+
* types that are no longer considered appropriate.
394+
*/
395+
Datum
396+
gin_tsquery_consistent_oldsig(PG_FUNCTION_ARGS)
397+
{
398+
returngin_tsquery_consistent(fcinfo);
399+
}

‎src/backend/utils/adt/tsgistidx.c

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -805,3 +805,16 @@ gtsvector_picksplit(PG_FUNCTION_ARGS)
805805

806806
PG_RETURN_POINTER(v);
807807
}
808+
809+
/*
810+
* Formerly, gtsvector_consistent was declared in pg_proc.h with arguments
811+
* that did not match the documented conventions for GiST support functions.
812+
* We fixed that, but we still need a pg_proc entry with the old signature
813+
* to support reloading pre-9.6 contrib/tsearch2 opclass declarations.
814+
* This compatibility function should go away eventually.
815+
*/
816+
Datum
817+
gtsvector_consistent_oldsig(PG_FUNCTION_ARGS)
818+
{
819+
returngtsvector_consistent(fcinfo);
820+
}

‎src/backend/utils/adt/tsquery_gist.c

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -262,3 +262,16 @@ gtsquery_picksplit(PG_FUNCTION_ARGS)
262262

263263
PG_RETURN_POINTER(v);
264264
}
265+
266+
/*
267+
* Formerly, gtsquery_consistent was declared in pg_proc.h with arguments
268+
* that did not match the documented conventions for GiST support functions.
269+
* We fixed that, but we still need a pg_proc entry with the old signature
270+
* to support reloading pre-9.6 contrib/tsearch2 opclass declarations.
271+
* This compatibility function should go away eventually.
272+
*/
273+
Datum
274+
gtsquery_consistent_oldsig(PG_FUNCTION_ARGS)
275+
{
276+
returngtsquery_consistent(fcinfo);
277+
}

‎src/include/catalog/catversion.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,6 @@
5353
*/
5454

5555
/*yyyymmddN */
56-
#defineCATALOG_VERSION_NO201603011
56+
#defineCATALOG_VERSION_NO201603021
5757

5858
#endif

‎src/include/catalog/pg_proc.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4516,6 +4516,8 @@ DATA(insert OID = 3653 ( gtsvector_penaltyPGNSP PGUID 12 1 0 0 0 f f f f t f
45164516
DESCR("GiST tsvector support");
45174517
DATA(insert OID = 3654 ( gtsvector_consistentPGNSP PGUID 12 1 0 0 0 f f f f t f i s 5 0 16 "2281 3614 21 26 2281" _null_ _null_ _null_ _null_ _null_ gtsvector_consistent _null_ _null_ _null_ ));
45184518
DESCR("GiST tsvector support");
4519+
DATA(insert OID = 3790 ( gtsvector_consistentPGNSP PGUID 12 1 0 0 0 f f f f t f i s 5 0 16 "2281 3642 23 26 2281" _null_ _null_ _null_ _null_ _null_ gtsvector_consistent_oldsig _null_ _null_ _null_ ));
4520+
DESCR("GiST tsvector support (obsolete)");
45194521

45204522
DATA(insert OID = 3656 ( gin_extract_tsvectorPGNSP PGUID 12 1 0 0 0 f f f f t f i s 3 0 2281 "3614 2281 2281" _null_ _null_ _null_ _null_ _null_gin_extract_tsvector _null_ _null_ _null_ ));
45214523
DESCR("GIN tsvector support");
@@ -4535,6 +4537,11 @@ DATA(insert OID = 3087 ( gin_extract_tsqueryPGNSP PGUID 12 1 0 0 0 f f f f t f
45354537
DESCR("GIN tsvector support (obsolete)");
45364538
DATA(insert OID = 3088 ( gin_tsquery_consistent PGNSP PGUID 12 1 0 0 0 f f f f t f i s 6 0 16 "2281 21 3615 23 2281 2281" _null_ _null_ _null_ _null_ _null_ gin_tsquery_consistent_6args _null_ _null_ _null_ ));
45374539
DESCR("GIN tsvector support (obsolete)");
4540+
DATA(insert OID = 3791 ( gin_extract_tsqueryPGNSP PGUID 12 1 0 0 0 f f f f t f i s 7 0 2281 "3615 2281 21 2281 2281 2281 2281" _null_ _null_ _null_ _null_ _null_ gin_extract_tsquery_oldsig _null_ _null_ _null_ ));
4541+
DESCR("GIN tsvector support (obsolete)");
4542+
DATA(insert OID = 3792 ( gin_tsquery_consistent PGNSP PGUID 12 1 0 0 0 f f f f t f i s 8 0 16 "2281 21 3615 23 2281 2281 2281 2281" _null_ _null_ _null_ _null_ _null_gin_tsquery_consistent_oldsig _null_ _null_ _null_ ));
4543+
DESCR("GIN tsvector support (obsolete)");
4544+
45384545
DATA(insert OID = 3789 ( gin_clean_pending_list PGNSP PGUID 12 1 0 0 0 f f f f t f v s 1 0 20 "2205" _null_ _null_ _null_ _null_ _null_ gin_clean_pending_list _null_ _null_ _null_ ));
45394546
DESCR("clean up GIN pending list");
45404547

@@ -4578,6 +4585,8 @@ DATA(insert OID = 3700 ( gtsquery_penaltyPGNSP PGUID 12 1 0 0 0 f f f f t f
45784585
DESCR("GiST tsquery support");
45794586
DATA(insert OID = 3701 ( gtsquery_consistentPGNSP PGUID 12 1 0 0 0 f f f f t f i s 5 0 16 "2281 3615 21 26 2281" _null_ _null_ _null_ _null_ _null_ gtsquery_consistent _null_ _null_ _null_ ));
45804587
DESCR("GiST tsquery support");
4588+
DATA(insert OID = 3793 ( gtsquery_consistentPGNSP PGUID 12 1 0 0 0 f f f f t f i s 5 0 16 "2281 2281 23 26 2281" _null_ _null_ _null_ _null_ _null_ gtsquery_consistent_oldsig _null_ _null_ _null_ ));
4589+
DESCR("GiST tsquery support (obsolete)");
45814590

45824591
DATA(insert OID = 3686 ( tsmatchselPGNSP PGUID 12 1 0 0 0 f f f f t f s s 4 0 701 "2281 26 2281 23" _null_ _null_ _null_ _null_ _null_ tsmatchsel _null_ _null_ _null_ ));
45834592
DESCR("restriction selectivity of tsvector @@ tsquery");

‎src/include/tsearch/ts_utils.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,7 @@ extern Datum gtsvector_union(PG_FUNCTION_ARGS);
132132
externDatumgtsvector_same(PG_FUNCTION_ARGS);
133133
externDatumgtsvector_penalty(PG_FUNCTION_ARGS);
134134
externDatumgtsvector_picksplit(PG_FUNCTION_ARGS);
135+
externDatumgtsvector_consistent_oldsig(PG_FUNCTION_ARGS);
135136

136137
/*
137138
* IO functions for pseudotype gtsvector
@@ -153,6 +154,8 @@ extern Datum gin_tsquery_triconsistent(PG_FUNCTION_ARGS);
153154
externDatumgin_extract_tsvector_2args(PG_FUNCTION_ARGS);
154155
externDatumgin_extract_tsquery_5args(PG_FUNCTION_ARGS);
155156
externDatumgin_tsquery_consistent_6args(PG_FUNCTION_ARGS);
157+
externDatumgin_extract_tsquery_oldsig(PG_FUNCTION_ARGS);
158+
externDatumgin_tsquery_consistent_oldsig(PG_FUNCTION_ARGS);
156159

157160
/*
158161
* Possible strategy numbers for indexes
@@ -217,6 +220,7 @@ extern Datum gtsquery_union(PG_FUNCTION_ARGS);
217220
externDatumgtsquery_same(PG_FUNCTION_ARGS);
218221
externDatumgtsquery_penalty(PG_FUNCTION_ARGS);
219222
externDatumgtsquery_picksplit(PG_FUNCTION_ARGS);
223+
externDatumgtsquery_consistent_oldsig(PG_FUNCTION_ARGS);
220224

221225
/*
222226
* Parser interface to SQL

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp