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

Commit472f608

Browse files
committed
One more hack to make contrib upgrades from 9.0 match fresh 9.1 installs.
intarray and tsearch2 both reference core support functions in their GINopclasses, and the signatures of those functions changed for 9.1. We addedbackwards-compatible pg_proc entries for the functions in order to allow9.0 dump files to be restored at all, but that hack leaves the opclassespointing at pg_proc entries different from what they'd point to if thecontrib modules were installed fresh in 9.1. To forestall any possibilityof future problems, fix the opclasses to match fresh installs via theexpedient of direct UPDATEs on pg_amproc in the update-from-unpackagedscripts. (Yech ... but the alternatives are worse, or require far moreeffort than seems justified right now.)Note: updating pg_amproc is sufficient because there will be no pg_dependentries corresponding to these dependencies, since the referenced functionsare all pinned.
1 parenta5dfc94 commit472f608

File tree

2 files changed

+59
-0
lines changed

2 files changed

+59
-0
lines changed

‎contrib/intarray/intarray--unpackaged--1.0.sql

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,3 +88,21 @@ WHERE oid = 'ginint4_queryextract(internal,internal,smallint,internal,internal)'
8888
UPDATEpg_catalog.pg_proc
8989
SET pronargs=8, proargtypes='2281 21 2281 23 2281 2281 2281 2281'
9090
WHEREoid='ginint4_consistent(internal,smallint,internal,integer,internal,internal)'::pg_catalog.regprocedure;
91+
92+
-- intarray also relies on the core function ginarrayextract, which changed
93+
-- signature in 9.1. To support upgrading, pg_catalog contains entries
94+
-- for ginarrayextract with both 2 and 3 args, and the former is what would
95+
-- have been added to our opclass during initial restore of a 9.0 dump script.
96+
-- Avert your eyes while we hack the pg_amproc entry to make it link to the
97+
-- 3-arg form ...
98+
99+
UPDATEpg_catalog.pg_amproc
100+
SET amproc='pg_catalog.ginarrayextract(anyarray,internal,internal)'::pg_catalog.regprocedure
101+
WHERE amprocfamily=
102+
(SELECToidFROMpg_catalog.pg_opfamilyWHERE opfname='gin__int_ops'AND
103+
opfnamespace= (SELECToidFROMpg_catalog.pg_namespace
104+
WHERE nspname=pg_catalog.current_schema()))
105+
AND amproclefttype='integer[]'::pg_catalog.regtype
106+
AND amprocrighttype='integer[]'::pg_catalog.regtype
107+
AND amprocnum=2
108+
AND amproc='pg_catalog.ginarrayextract(anyarray,internal)'::pg_catalog.regprocedure;

‎contrib/tsearch2/tsearch2--unpackaged--1.0.sql

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,3 +98,44 @@ ALTER EXTENSION tsearch2 ADD operator family @extschema@.tsvector_ops using btre
9898
ALTER EXTENSION tsearch2 ADD operator class @extschema@.tsvector_ops using btree;
9999
ALTER EXTENSION tsearch2 ADD operator family @extschema@.tsquery_ops using btree;
100100
ALTER EXTENSION tsearch2 ADD operator class @extschema@.tsquery_ops using btree;
101+
102+
-- tsearch2 relies on the core functions gin_extract_tsvector,
103+
-- gin_extract_tsquery, and gin_tsquery_consistent, which changed signature in
104+
-- 9.1. To support upgrading, pg_catalog contains entries for these functions
105+
-- with both the old and new signatures, and the former is what would have
106+
-- been added to our opclass during initial restore of a 9.0 dump script.
107+
-- Avert your eyes while we hack the pg_amproc entries to make them link to
108+
-- the new forms ...
109+
110+
UPDATEpg_catalog.pg_amproc
111+
SET amproc='pg_catalog.gin_extract_tsvector(pg_catalog.tsvector,internal,internal)'::pg_catalog.regprocedure
112+
WHERE amprocfamily=
113+
(SELECToidFROMpg_catalog.pg_opfamilyWHERE opfname='gin_tsvector_ops'AND
114+
opfnamespace= (SELECToidFROMpg_catalog.pg_namespace
115+
WHERE nspname='@extschema@'))
116+
AND amproclefttype='pg_catalog.tsvector'::pg_catalog.regtype
117+
AND amprocrighttype='pg_catalog.tsvector'::pg_catalog.regtype
118+
AND amprocnum=2
119+
AND amproc='pg_catalog.gin_extract_tsvector(pg_catalog.tsvector,internal)'::pg_catalog.regprocedure;
120+
121+
UPDATEpg_catalog.pg_amproc
122+
SET amproc='pg_catalog.gin_extract_tsquery(pg_catalog.tsquery,internal,smallint,internal,internal,internal,internal)'::pg_catalog.regprocedure
123+
WHERE amprocfamily=
124+
(SELECToidFROMpg_catalog.pg_opfamilyWHERE opfname='gin_tsvector_ops'AND
125+
opfnamespace= (SELECToidFROMpg_catalog.pg_namespace
126+
WHERE nspname='@extschema@'))
127+
AND amproclefttype='pg_catalog.tsvector'::pg_catalog.regtype
128+
AND amprocrighttype='pg_catalog.tsvector'::pg_catalog.regtype
129+
AND amprocnum=3
130+
AND amproc='pg_catalog.gin_extract_tsquery(pg_catalog.tsquery,internal,smallint,internal,internal)'::pg_catalog.regprocedure;
131+
132+
UPDATEpg_catalog.pg_amproc
133+
SET amproc='pg_catalog.gin_tsquery_consistent(internal,smallint,pg_catalog.tsquery,integer,internal,internal,internal,internal)'::pg_catalog.regprocedure
134+
WHERE amprocfamily=
135+
(SELECToidFROMpg_catalog.pg_opfamilyWHERE opfname='gin_tsvector_ops'AND
136+
opfnamespace= (SELECToidFROMpg_catalog.pg_namespace
137+
WHERE nspname='@extschema@'))
138+
AND amproclefttype='pg_catalog.tsvector'::pg_catalog.regtype
139+
AND amprocrighttype='pg_catalog.tsvector'::pg_catalog.regtype
140+
AND amprocnum=4
141+
AND amproc='pg_catalog.gin_tsquery_consistent(internal,smallint,pg_catalog.tsquery,integer,internal,internal)'::pg_catalog.regprocedure;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp