Re: Upgrading DBs with type=citext from 9.0.5 to 9.1.1 using pg_upgrade and create extension

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Rudolf van der Leeden <rudolf(dot)vanderleeden(at)scoreloop(dot)com>
Cc: pgsql-admin(at)postgresql(dot)org, Rudolf van der Leeden <vanderleeden(at)logicunited(dot)com>
Subject: Re: Upgrading DBs with type=citext from 9.0.5 to 9.1.1 using pg_upgrade and create extension
Date: 2011-11-21 14:51:00
Message-ID: 9017.1321887060@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

Rudolf van der Leeden <rudolf(dot)vanderleeden(at)scoreloop(dot)com> writes:
> we are running into a problem with the following upgrade scenario:

> Current DB (9.0.5, 300G) is using a table with 2 citext columns and indexes on both columns.
> Using pg_upgrade to move from 9.0.5 to 9.1.1 works OK and is done (without the ANALYZE) in 30s.
> Because we are using the citext type, the following statement has been executed after the upgrade:
> CREATE EXTENSION citext FROM unpackaged

> SELECTs are now possible, but we are having problems with UPDATE:
> ERROR: could not determine which collation to use for string comparison

Hmm. I think the citext update script is missing a couple of things.
Try this after the CREATE EXTENSION step:

update pg_attribute set attcollation = 100 where atttypid = 'citext'::regtype;

It looks like pg_index.indcollation is an issue too, but the least
fragile way to fix that might be to drop and recreate indexes on
citext columns.

regards, tom lane

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Tom Lane 2011-11-21 16:27:46 Re: Upgrading DBs with type=citext from 9.0.5 to 9.1.1 using pg_upgrade and create extension
Previous Message PresleyDias 2011-11-21 07:54:50 Postgres database creation using batch files