Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 0024e34

Browse files
committed
Fix upgrade of contrib/intarray and contrib/unaccent from 9.0.
Take care of a couple of discrepancies between what you get from a fresh install and what the first-draft update-from-unpackaged scripts produced.
1 parent ec65a79 commit 0024e34

File tree

2 files changed

+23
-2
lines changed

2 files changed

+23
-2
lines changed

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

+18-2
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,23 @@ ALTER EXTENSION intarray ADD operator class gist__intbig_ops using gist;
6868
ALTER EXTENSION intarray ADD operator family gin__int_ops using gin;
6969
ALTER EXTENSION intarray ADD operator class gin__int_ops using gin;
7070

71-
-- these two functions have different signatures in 9.1, but we don't
72-
-- bother trying to fix them because GIN doesn't care much
71+
-- These functions had different signatures in 9.0. We can't just
72+
-- drop and recreate them because they are linked into the GIN opclass,
73+
-- so we need some ugly hacks.
74+
75+
-- First, absorb them into the extension under their old identities.
76+
7377
ALTER EXTENSION intarray ADD function ginint4_queryextract(internal,internal,smallint,internal,internal);
7478
ALTER EXTENSION intarray ADD function ginint4_consistent(internal,smallint,internal,integer,internal,internal);
79+
80+
-- Next, fix the parameter lists by means of direct UPDATE on the pg_proc
81+
-- entries. This is ugly as can be, but there's no other way to do it
82+
-- while preserving the identities (OIDs) of the functions.
83+
84+
UPDATE pg_catalog.pg_proc
85+
SET pronargs = 7, proargtypes = '2281 2281 21 2281 2281 2281 2281'
86+
WHERE oid = 'ginint4_queryextract(internal,internal,smallint,internal,internal)'::pg_catalog.regprocedure;
87+
88+
UPDATE pg_catalog.pg_proc
89+
SET pronargs = 8, proargtypes = '2281 21 2281 23 2281 2281 2281 2281'
90+
WHERE oid = 'ginint4_consistent(internal,smallint,internal,integer,internal,internal)'::pg_catalog.regprocedure;

contrib/unaccent/unaccent--unpackaged--1.0.sql

+5
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,8 @@ ALTER EXTENSION unaccent ADD function unaccent_init(internal);
66
ALTER EXTENSION unaccent ADD function unaccent_lexize(internal,internal,internal,internal);
77
ALTER EXTENSION unaccent ADD text search template unaccent;
88
ALTER EXTENSION unaccent ADD text search dictionary unaccent;
9+
10+
-- These functions are marked as stable in 9.1, were not before:
11+
12+
ALTER FUNCTION unaccent(regdictionary, text) STABLE;
13+
ALTER FUNCTION unaccent(text) STABLE;

0 commit comments

Comments
 (0)