pgsql: Fix citext upgrade script for disallowance of oidvector element

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Fix citext upgrade script for disallowance of oidvector element
Date: 2014-08-28 22:21:39
Message-ID: E1XN84Z-0003AL-2F@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Fix citext upgrade script for disallowance of oidvector element assignment.

In commit 45e02e3232ac7cc5ffe36f7986159b5e0b1f6fdc, we intentionally
disallowed updates on individual elements of oidvector columns. While that
still seems like a sane idea in the abstract, we (I) forgot that citext's
"upgrade from unpackaged" script did in fact perform exactly such updates,
in order to fix the problem that citext indexes should have a collation
but would not in databases dumped or upgraded from pre-9.1 installations.

Even if we wanted to add casts to allow such updates, there's no practical
way to do so in the back branches, so the only real alternative is to make
citext's kluge even klugier. In this patch, I cast the oidvector to text,
fix its contents with regexp_replace, and cast back to oidvector. (Ugh!)

Since the aforementioned commit went into all active branches, we have to
fix this in all branches that contain the now-broken update script.

Per report from Eric Malm.

Branch
------
REL9_2_STABLE

Details
-------
http://git.postgresql.org/pg/commitdiff/f3998521fcca0faf237fcf7e66a7462ab2e30310

Modified Files
--------------
contrib/citext/citext--unpackaged--1.0.sql | 28 ++++++++++++++++++++--------
1 file changed, 20 insertions(+), 8 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Noah Misch 2014-08-29 00:38:56 pgsql: Always use our getaddrinfo.c on Windows.
Previous Message Fujii Masao 2014-08-28 20:27:54 Re: pgsql: Allow units to be specified in relation option setting value.