From 557a05f3843c486e79e01da32c1baa397a352c9a Mon Sep 17 00:00:00 2001 From: saper Date: Thu, 19 Apr 2012 11:59:55 +0200 Subject: [PATCH] bug 36087: PostgresUpdater fails on 8.3.14 PostgresUpdater fails on PostgreSQL 8.3.14: > Changing 'image.img_metadata' default value > A database query syntax error has occurred. > The last attempted database query was: > "ALTER TABLE image ALTER img_metadata SET DEFAULT '\x'::bytea" > from within function "". > Database returned error "22P02: ERROR: invalid input syntax for type > bytea" Patchset 2: > Database returned error "42883: ERROR: function > generate_subscripts(int2vector, integer) does not exist > LINE 7: (SELECT generate_subscripts(isub.indkey, 1) AS g > ^ > HINT: No function matches the given name and argument types. You > might need to add explicit type casts. > " Change-Id: I6e1811ded0eedad9c0eb0df715698c45aaf8e3f0 --- includes/db/DatabasePostgres.php | 2 +- includes/installer/PostgresUpdater.php | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/includes/db/DatabasePostgres.php b/includes/db/DatabasePostgres.php index fc9c65a806..a11b173381 100644 --- a/includes/db/DatabasePostgres.php +++ b/includes/db/DatabasePostgres.php @@ -559,7 +559,7 @@ class DatabasePostgres extends DatabaseBase { i.indoption[s.g] as option, pg_am.amname FROM - (SELECT generate_subscripts(isub.indkey, 1) AS g + (SELECT generate_series(array_lower(isub.indkey,1), array_upper(isub.indkey,1)) AS g FROM pg_index isub JOIN pg_class cis diff --git a/includes/installer/PostgresUpdater.php b/includes/installer/PostgresUpdater.php index 0d27c5a1ab..a03c6c4520 100644 --- a/includes/installer/PostgresUpdater.php +++ b/includes/installer/PostgresUpdater.php @@ -185,9 +185,7 @@ class PostgresUpdater extends DatabaseUpdater { array( 'changeNullableField', 'oldimage', 'oi_timestamp', 'NULL' ), array( 'changeNullableField', 'oldimage', 'oi_major_mime', 'NULL' ), array( 'changeNullableField', 'oldimage', 'oi_minor_mime', 'NULL' ), - array( 'setDefault', 'image', 'img_metadata', '\'\x\'::bytea'), array( 'changeNullableField', 'image', 'img_metadata', 'NOT NULL'), - array( 'setDefault', 'filearchive', 'fa_metadata', '\'\x\'::bytea'), array( 'changeNullableField', 'filearchive', 'fa_metadata', 'NOT NULL'), array( 'changeNullableField', 'recentchanges', 'rc_cur_id', 'NULL' ), -- 2.20.1