summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Lane2011-02-17 22:45:09 +0000
committerTom Lane2011-02-17 22:45:09 +0000
commit0024e348989254d48dc4afe9beab98a6994a791e (patch)
treeeeffc5a0e6946b5be19b67133a406a7d3943e913
parentec65a79db2a423a156cda8e862d34052d7175a86 (diff)
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.
-rw-r--r--contrib/intarray/intarray--unpackaged--1.0.sql20
-rw-r--r--contrib/unaccent/unaccent--unpackaged--1.0.sql5
2 files changed, 23 insertions, 2 deletions
diff --git a/contrib/intarray/intarray--unpackaged--1.0.sql b/contrib/intarray/intarray--unpackaged--1.0.sql
index 69bdc589b6..238ddfeea1 100644
--- a/contrib/intarray/intarray--unpackaged--1.0.sql
+++ b/contrib/intarray/intarray--unpackaged--1.0.sql
@@ -68,7 +68,23 @@ ALTER EXTENSION intarray ADD operator class gist__intbig_ops using gist;
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
+-- These functions had different signatures in 9.0. We can't just
+-- drop and recreate them because they are linked into the GIN opclass,
+-- so we need some ugly hacks.
+
+-- First, absorb them into the extension under their old identities.
+
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);
+
+-- Next, fix the parameter lists by means of direct UPDATE on the pg_proc
+-- entries. This is ugly as can be, but there's no other way to do it
+-- while preserving the identities (OIDs) of the functions.
+
+UPDATE pg_catalog.pg_proc
+SET pronargs = 7, proargtypes = '2281 2281 21 2281 2281 2281 2281'
+WHERE oid = 'ginint4_queryextract(internal,internal,smallint,internal,internal)'::pg_catalog.regprocedure;
+
+UPDATE pg_catalog.pg_proc
+SET pronargs = 8, proargtypes = '2281 21 2281 23 2281 2281 2281 2281'
+WHERE oid = 'ginint4_consistent(internal,smallint,internal,integer,internal,internal)'::pg_catalog.regprocedure;
diff --git a/contrib/unaccent/unaccent--unpackaged--1.0.sql b/contrib/unaccent/unaccent--unpackaged--1.0.sql
index 7b36d29512..eeb9c532f9 100644
--- a/contrib/unaccent/unaccent--unpackaged--1.0.sql
+++ b/contrib/unaccent/unaccent--unpackaged--1.0.sql
@@ -6,3 +6,8 @@ ALTER EXTENSION unaccent ADD function unaccent_init(internal);
ALTER EXTENSION unaccent ADD function unaccent_lexize(internal,internal,internal,internal);
ALTER EXTENSION unaccent ADD text search template unaccent;
ALTER EXTENSION unaccent ADD text search dictionary unaccent;
+
+-- These functions are marked as stable in 9.1, were not before:
+
+ALTER FUNCTION unaccent(regdictionary, text) STABLE;
+ALTER FUNCTION unaccent(text) STABLE;