Skip site navigation (1) Skip section navigation (2)

pg_upgrade from 9.0.7 to 9.1.3: duplicate key pg_authid_oid_index

From: Bryan Murphy <bmurphy1976(at)gmail(dot)com>
To: PGSQL Mailing List <pgsql-general(at)postgresql(dot)org>
Subject: pg_upgrade from 9.0.7 to 9.1.3: duplicate key pg_authid_oid_index
Date: 2012-05-31 20:55:45
Message-ID: CAP+1M2f-jaaQ87=ZcrVxHwQh7Xg+F+ijhyy7wdiiGmcg1=fP4g@mail.gmail.com (view raw or flat)
Thread:
Lists: pgsql-generalpgsql-hackers
I'm having a problem upgrading a cluster from 9.0.7 to 9.1.3.  Here's the
error:

psql:/srv/pg_upgrade_dump_globals.sql:54: ERROR:  duplicate key value
violates unique constraint "pg_authid_oid_index"
DETAIL:  Key (oid)=(10) already exists.

Any ideas what I'm doing wrong?

Here's the verbose output from pg_upgrade:

$ /opt/postgresql-9.1/bin/pg_upgrade --link --verbose
--old-datadir=/srv/postgresql/pg_data --new-datadir=/srv/postgres-9.1
--old-bindir=/opt/postgresql-9.0/bin --new-bindir=/opt/postgresql-9.1/bin
Running in verbose mode
Performing Consistency Checks
-----------------------------
Checking current, bin, and data directories                 ok
Checking cluster versions                                   ok
"/opt/postgresql-9.0/bin/pg_ctl" -w -l "/dev/null" -D
"/srv/postgresql/pg_data" -o "-p 5432 -c autovacuum=off -c
autovacuum_freeze_max_age=2000000000" start >> "/dev/null" 2>&1
Checking database user is a superuser                       ok
Checking for prepared transactions                          ok
Checking for reg* system oid user data types                ok
Checking for contrib/isn with bigint-passing mismatch       ok
Creating catalog dump
"/opt/postgresql-9.1/bin/pg_dumpall" --port 5432 --username "postgres"
--schema-only --binary-upgrade > "/srv/pg_upgrade_dump_all.sql"
ok
"/opt/postgresql-9.0/bin/pg_ctl" -w -l "/dev/null" -D
"/srv/postgresql/pg_data"  stop >> "/dev/null" 2>&1
"/opt/postgresql-9.1/bin/pg_ctl" -w -l "/dev/null" -D "/srv/postgres-9.1"
-o "-p 5432 -b" start >> "/dev/null" 2>&1
Checking for prepared transactions                          ok
Checking for presence of required libraries                 ok

| If pg_upgrade fails after this point, you must
| re-initdb the new cluster before continuing.
| You will also need to remove the ".old" suffix
| from /srv/postgresql/pg_data/global/pg_control.old.

Performing Upgrade
------------------
Adding ".old" suffix to old global/pg_control               ok
Analyzing all rows in the new cluster
"/opt/postgresql-9.1/bin/vacuumdb" --port 5432 --username "postgres" --all
--analyze >> "/dev/null" 2>&1
ok
Freezing all rows on the new cluster
 "/opt/postgresql-9.1/bin/vacuumdb" --port 5432 --username "postgres" --all
--freeze >> "/dev/null" 2>&1
ok
"/opt/postgresql-9.1/bin/pg_ctl" -w -l "/dev/null" -D "/srv/postgres-9.1"
 stop >> "/dev/null" 2>&1
Deleting new commit clogs                                   ok
Copying old commit clogs to new server                      cp -Rf
"/srv/postgresql/pg_data/pg_clog" "/srv/postgres-9.1/pg_clog"
ok
Setting next transaction id for new cluster
"/opt/postgresql-9.1/bin/pg_resetxlog" -f -x 743542427 "/srv/postgres-9.1"
> /dev/null
ok
Resetting WAL archives
 "/opt/postgresql-9.1/bin/pg_resetxlog" -l 1,829,15 "/srv/postgres-9.1" >>
"/dev/null" 2>&1
ok
"/opt/postgresql-9.1/bin/pg_ctl" -w -l "/dev/null" -D "/srv/postgres-9.1"
-o "-p 5432 -b" start >> "/dev/null" 2>&1
Setting frozenxid counters in new cluster                   ok
Creating databases in the new cluster
"/opt/postgresql-9.1/bin/psql" --set ON_ERROR_STOP=on --no-psqlrc --port
5432 --username "postgres" -f "/srv/pg_upgrade_dump_globals.sql" --dbname
template1 >> "/dev/null"
psql:/srv/pg_upgrade_dump_globals.sql:54: ERROR:  duplicate key value
violates unique constraint "pg_authid_oid_index"
DETAIL:  Key (oid)=(10) already exists.

There were problems executing "/opt/postgresql-9.1/bin/psql" --set
ON_ERROR_STOP=on --no-psqlrc --port 5432 --username "postgres" -f
"/srv/pg_upgrade_dump_globals.sql" --dbname template1 >> "/dev/null"
Failure, exiting
"/opt/postgresql-9.1/bin/pg_ctl" -w -l "/dev/null" -D "/srv/postgres-9.1"
-m fast stop >> "/dev/null" 2>&1

Thanks,
Bryan

Responses

pgsql-hackers by date

Next:From: Jeff DavisDate: 2012-05-31 21:28:54
Subject: Re: pg_upgrade from 9.0.7 to 9.1.3: duplicate key pg_authid_oid_index
Previous:From: Kohei KaiGaiDate: 2012-05-31 20:55:27
Subject: Re: [RFC] Interface of Row Level Security

pgsql-general by date

Next:From: John TownsendDate: 2012-05-31 20:57:54
Subject: Re: Procedural Languages
Previous:From: Mike ToewsDate: 2012-05-31 20:13:28
Subject: Re: Procedural Languages

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group