Re: Re: [GENERAL] pg_upgrade fails, "mismatch of relation OID" - 9.1.9 to 9.2.4

From: Bruce Momjian <bruce(at)momjian(dot)us>
To: "Evan D(dot) Hoffman" <evandhoffman(at)gmail(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Igor Neyman <ineyman(at)perceptron(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Re: [GENERAL] pg_upgrade fails, "mismatch of relation OID" - 9.1.9 to 9.2.4
Date: 2013-05-09 23:25:59
Message-ID: 20130509232559.GG24521@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers

On Thu, May 9, 2013 at 05:41:39PM -0400, Evan D. Hoffman wrote:
> I believe the history of this cluster is that it started on 9.0 and
> was upgraded to 9.1 via pg_upgrade. The instance I'm working on was
> created as a streaming replica, then I broke the replication to make
> it a standalone master specifically for testing pg_upgrade to 9.2.

OK, I did some research on this, using a stripped-down copy of his table
schema:

CREATE TABLE test(
x1 bigint,
x2 bigint,
x3 CHARACTER varying(40),
x4 CHARACTER varying(40),
x5 CHARACTER varying(40),
x6 CHARACTER varying(40),
x7 CHARACTER varying(40),
x8 CHARACTER varying(40),
x9 boolean,
x10 CHARACTER varying(40),
x11 boolean,
x12 CHARACTER varying(100),
x13 CHARACTER varying(100),
x14 DATE,
x15 DATE,
x16 CHARACTER varying(10),
x17 CHARACTER varying(10)
);

Using my default UTF8 encoding, I see a TOAST table created for all
versions of Postgres, 9.0 through 9.3. However, if I create a database
with C locale/Latin1 encoding:

CREATE DATABASE test3 ENCODING 'LATIN1' LC_COLLATE 'C'
LC_CTYPE 'C' TEMPLATE template0;

I then get a table with no TOAST table. Could the encoding of this
database have changed? I know pg_upgrade has always tests to see
old/new clusters had matching "LC_COLLATE" and "LC_CTYPE" match. It is
possible that the encodings were changed, and pg_upgrade didn't test
that? I don't think so because pg_dumpall is the one who creates the
new databases with matching encodings.

Could someone have manually changed the encoding of the 9.1 database in
the system tables? If so, that would cause this problem.

--
Bruce Momjian <bruce(at)momjian(dot)us> http://momjian.us
EnterpriseDB http://enterprisedb.com

+ It's impossible for everything to be true. +

--
Sent via pgsql-hackers mailing list (pgsql-hackers(at)postgresql(dot)org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Julian 2013-05-10 00:24:19 Re: Design advice requested
Previous Message Bruce Momjian 2013-05-09 22:19:31 Re: Re: [GENERAL] pg_upgrade fails, "mismatch of relation OID" - 9.1.9 to 9.2.4

Browse pgsql-hackers by date

  From Date Subject
Next Message Evan D. Hoffman 2013-05-10 01:22:55 Re: Re: [GENERAL] pg_upgrade fails, "mismatch of relation OID" - 9.1.9 to 9.2.4
Previous Message Jeff Davis 2013-05-09 22:53:41 Re: corrupt pages detected by enabling checksums