Received: from magus.postgresql.org (magus.postgresql.org [87.238.57.229]) by mail.postgresql.org (Postfix) with ESMTP id C2809105A46C for ; Mon, 21 Nov 2011 10:51:27 -0400 (AST) Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1RSVDP-0003F3-Ob for pgsql-admin@postgresql.org; Mon, 21 Nov 2011 14:51:27 +0000 Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.2/8.14.2) with ESMTP id pALEp0nj009018; Mon, 21 Nov 2011 09:51:00 -0500 (EST) To: Rudolf van der Leeden cc: pgsql-admin@postgresql.org, Rudolf van der Leeden Subject: Re: Upgrading DBs with type=citext from 9.0.5 to 9.1.1 using pg_upgrade and create extension In-reply-to: <42DFCA4F-34A9-4265-9A99-A45E45021FFA@logicunited.com> References: <42DFCA4F-34A9-4265-9A99-A45E45021FFA@logicunited.com> Comments: In-reply-to Rudolf van der Leeden message dated "Sun, 20 Nov 2011 23:11:36 +0100" Date: Mon, 21 Nov 2011 09:51:00 -0500 Message-ID: <9017.1321887060@sss.pgh.pa.us> From: Tom Lane X-Archive-Number: 201111/105 X-Sequence-Number: 38699 Rudolf van der Leeden 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