Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1VyPI6-0006vT-Oe for pgsql-general@arkaria.postgresql.org; Wed, 01 Jan 2014 17:09:11 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1VyPI5-0000D5-VN for pgsql-general@arkaria.postgresql.org; Wed, 01 Jan 2014 17:09:09 +0000 Received: from makus.postgresql.org ([2001:4800:7903:4::125]) by malur.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1VyPI3-0000Cu-B3 for pgsql-general@postgresql.org; Wed, 01 Jan 2014 17:09:07 +0000 Received: from zixgateway01.rowan.edu ([150.250.76.11]) by makus.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1VyPHu-0001Nf-Ft for pgsql-general@postgresql.org; Wed, 01 Jan 2014 17:09:05 +0000 Received: from 127.0.0.1 (ZixVPM [127.0.0.1]) by Outbound.rowan.edu (Proprietary) with SMTP id 3834A2F51FA for ; Wed, 1 Jan 2014 12:08:20 -0500 (EST) Received: from mx5.rowan.edu (mx5.rowan.edu [150.250.65.17]) by zixgateway01.rowan.edu (Proprietary) with ESMTP id 95BD92F51F9 for ; Wed, 1 Jan 2014 12:08:19 -0500 (EST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AiQIACxLxFKW+kA0/2dsb2JhbABVA4JHfE+wSYhagSt0giUBAgSBBwQBCBEDAQIoIhcUCQgBAQQTiAMJm1qkD4RTFwSOLiI4ARYBEYQlBIlDjlSBMIkbghKFN4NLgUs X-IPAS-Result: AiQIACxLxFKW+kA0/2dsb2JhbABVA4JHfE+wSYhagSt0giUBAgSBBwQBCBEDAQIoIhcUCQgBAQQTiAMJm1qkD4RTFwSOLiI4ARYBEYQlBIlDjlSBMIkbghKFN4NLgUs X-IronPort-AV: E=Sophos;i="4.95,586,1384318800"; d="scan'208,217";a="32874642" Received: from exchange2007-ca-2.rowan.edu (HELO ex2k7-ca-2.rowanads.rowan.edu) ([150.250.64.52]) by mx2-outbound.rowan.edu with ESMTP; 01 Jan 2014 12:08:55 -0500 Received: from EX2K7-MB-10.rowanads.rowan.edu ([150.250.64.34]) by ex2k7-ca-2.rowanads.rowan.edu ([2002:96fa:4034::96fa:4034]) with mapi; Wed, 1 Jan 2014 12:08:05 -0500 From: "Reiser, John J." To: "pgsql-general@postgresql.org" Date: Wed, 1 Jan 2014 12:08:53 -0500 Subject: Re: duplicate OID issue when using pg_upgrade to move from 8.4 to 9.2 Thread-Topic: [GENERAL] duplicate OID issue when using pg_upgrade to move from 8.4 to 9.2 Thread-Index: Ac8HFAkgYIPtC7G+RhWylmBJg+imbQ== Message-ID: In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: user-agent: Microsoft-MacOutlook/14.2.3.120616 acceptlanguage: en-US Content-Type: multipart/alternative; boundary="_000_CEE9B5421D25Areiserrowanedu_" MIME-Version: 1.0 X-VPM-MSG-ID: e38775e8-c296-4ce0-bdeb-74806245b4c9 X-VPM-HOST: zixgateway01.rowan.edu X-VPM-ENC-REGIME: Plaintext X-VPM-CERT-FLAG: 0 X-VPM-IS-HYBRID: 0 X-Pg-Spam-Score: -0.0 (/) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-general Precedence: bulk Sender: pgsql-general-owner@postgresql.org --_000_CEE9B5421D25Areiserrowanedu_ Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable The --link argument doesn't work, either: bash-4.1$ export LD_LIBRARY_PATH=3D/usr/pgsql-9.2/lib bash-4.1$ /usr/pgsql-9.2/bin/pg_upgrade --old-datadir=3D/var/lib/pgsql/data= --new-datadir=3D/var/lib/pgsql/9.2/data --old-bindir=3D/usr/bin --new-bind= ir=3D/usr/pgsql-9.2/bin --check Performing Consistency Checks ----------------------------- Checking current, bin, and data directories ok Checking cluster versions ok 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 Checking for large objects ok Checking for presence of required libraries ok Checking database user is a superuser ok Checking for prepared transactions ok *Clusters are compatible* bash-4.1$ /usr/pgsql-9.2/bin/pg_upgrade --old-datadir=3D/var/lib/pgsql/data= --new-datadir=3D/var/lib/pgsql/9.2/data --old-bindir=3D/usr/bin --new-bind= ir=3D/usr/pgsql-9.2/bin --link Performing Consistency Checks ----------------------------- Checking current, bin, and data directories ok Checking cluster versions ok 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 Checking for large objects ok Creating catalog dump ok Checking for presence of required libraries ok Checking database user is a superuser ok Checking for prepared transactions ok If pg_upgrade fails after this point, you must re-initdb the new cluster before continuing. Performing Upgrade ------------------ Analyzing all rows in the new cluster ok Freezing all rows on the new cluster ok Deleting files from new pg_clog ok Copying old pg_clog to new server ok Setting next transaction ID for new cluster ok Resetting WAL archives ok Setting frozenxid counters in new cluster ok Creating databases in the new cluster ok Adding support functions to new cluster ok Restoring database schema to new cluster *failure* Consult the last few lines of "pg_upgrade_restore.log" for the probable cause of the failure. Failure, exiting bash-4.1$ tail -n 20 pg_upgrade_restore.log (1 row) CREATE TYPE "spheroid" ( INTERNALLENGTH =3D 65, INPUT =3D spheroid_in, OUTPUT =3D spheroid_out, ALIGNMENT =3D double, STORAGE =3D plain ); CREATE TYPE ALTER TYPE "public"."spheroid" OWNER TO "reiser"; ALTER TYPE SET search_path =3D "sde", pg_catalog; SET CREATE FUNCTION "st_envelope_in"(cstring) RETURNS st_envelope LANGUAGE "c" IMMUTABLE STRICT AS 'st_geometry', 'ST_ENVELOPE_In'; psql:pg_upgrade_dump_db.sql:371910: ERROR: duplicate key value violates un= ique constraint "pg_type_oid_index" DETAIL: Key (oid)=3D(1407909) already exists. Again, any help that you could provide would be greatly appreciated. John From: , John Reiser > Date: Wednesday, January 1, 2014 at 11:53 AM To: "pgsql-general@postgresql.org" > Subject: [GENERAL] duplicate OID issue when using pg_upgrade to move from 8= .4 to 9.2 Hello, I'm working on an upgrade to our database cluster, attempting to move from = 8.4 to 9.2. I'm encountering the following error when I attempt the upgrade= (in pg_upgrade_restore.log): CREATE FUNCTION "st_envelope_in"(cstring) RETURNS st_envelope LANGUAGE "c" IMMUTABLE STRICT AS 'st_geometry', 'ST_ENVELOPE_In'; psql:pg_upgrade_dump_db.sql:371910: ERROR: duplicate key value violates un= ique constraint "pg_type_oid_index" DETAIL: Key (oid)=3D(1407909) already exists. I'm running this on CentOS 6; both 8.4 and 9.2 are installed from the Yum r= epository. PostgreSQL is primarily used for GIS data and has ESRI st_geomet= ry and PostGIS installed in several of the databases. (ESRI's support is on= ly up to 9.2, which is why I'm not attempting a move to 9.3.) The interesti= ng thing with this error is that when I wipe out the 9.2 data directory, re= -initdb, and run the upgrade again, I now get a different error: CREATE TABLESPACE "sde1" OWNER "sde" LOCATION '/disk2/pgsql/data/sde'; psql:pg_upgrade_dump_globals.sql:294: ERROR: directory "/disk2/pgsql/data/= sde/PG_9.2_201204301" already in use as a tablespace (I have several of our ESRI SDE databases in their own tablespace.) Before starting this process, I made a complete file-based backup of the 8.= 4 data directory. When I restore the backup to /var/lib/pgsql and run pg_up= grade again, I receive the first error again, with the same exact OID value= . I will admit I don't know much about Postgres internals and I'm not sure = how to proceed with this duplicate OID issue. I'm going to try running pg_upgrade with the link option now, but I don't k= now if that will help. Any assistance provided would be greatly appreciated. Thanks, John John Reiser Geospatial Research Lab Rowan University 201 Mullica Hill Road Glassboro, NJ 08028 phone: 856-256-4817 cell: 856-347-0047 twitter: @rowangeolab --_000_CEE9B5421D25Areiserrowanedu_ Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable
The --link= argument doesn't work, either:

bash-4.1$ export LD_= LIBRARY_PATH=3D/usr/pgsql-9.2/lib 
bash-4.1$ /usr/pgsql-9.2/bin/pg_upgrade --old-datadir=3D/var/lib/pgsq= l/data --new-datadir=3D/var/lib/pgsql/9.2/data --old-bindir=3D/usr/bin --ne= w-bindir=3D/usr/pgsql-9.2/bin --check
Performing Consistency Checks
= -----------------------------
Chec= king current, bin, and data directories           =       ok
Checking c= luster versions                 &nb= sp;                 ok
=
Checking database user is a superuser   &= nbsp;                   ok
Checking for prepared transactions &n= bsp;                     =    ok
Checking for reg* = system OID user data types              =  ok
Checking for contrib/isn= with bigint-passing mismatch       ok
Checking for large objects         =                      = ;    ok
Checking for pre= sence of required libraries              = ;   ok
Checking database user= is a superuser                 &nb= sp;     ok
Checking for = prepared transactions               &nbs= p;          ok

*Clusters are compatibl= e*

bash-4.1$ /usr/pgsql-9.2/bin/pg_upgrade --old-datadir=3D/var= /lib/pgsql/data --new-datadir=3D/var/lib/pgsql/9.2/data --old-bindir=3D/usr= /bin --new-bindir=3D/usr/pgsql-9.2/bin --link
Performing Consistency Checks
-----------------------------
Checking current, bin, and data directories       &nbs= p;         ok
= Checking cluster versions               =                     ok
Checking database user is a superuse= r                     &nb= sp; ok
Checking for prepared trans= actions                   &nbs= p;      ok
Checking= for reg* system OID user data types           &nb= sp;    ok
Checking for c= ontrib/isn with bigint-passing mismatch       ok
Checking for large objects     &nbs= p;                     &n= bsp;      ok
Creati= ng catalog dump                 &nb= sp;                     o= k
Checking for presence of require= d libraries                 ok
Checking database user is a superuser =                      = ; ok
Checking for prepared transac= tions                    =      ok

If pg_upgrade fails after this point, y= ou must re-initdb the
new cluster = before continuing.

Performing Upgrade
------------------
Analyzing all rows in the new cluster           &= nbsp;           ok
Freezing all rows on the new cluster         =                ok
= Deleting files from new pg_clog      = ;                     &nb= sp; ok
Copying old pg_clog to new = server                    = ;       ok
Setting = next transaction ID for new cluster           &nbs= p;     ok
Resetting WAL = archives                   &nb= sp;                  ok=
Setting frozenxid counters in new cluste= r                   ok<= /div>
Creating databases in the new cluster &nb= sp;                     o= k
Adding support functions to new = cluster                   &nbs= p; ok
Restoring database schema to= new cluster                  =  *failure*

=
Consult the last few lines of "pg_upgrade_rest= ore.log" for
the probable cause of= the failure.
Failure, exiting
bash-4.1$ tail -n 20 pg_upgrade_resto= re.log 
 
(1 row)

CREATE TYPE "spheroid" (
    INTERNALLENGTH =3D 65,<= /font>
    INPUT =3D spheroid_i= n,
    OUTPUT =3D sphero= id_out,
    ALIGNMENT = =3D double,
    STORAGE = =3D plain
);
CREATE TYPE
AL= TER TYPE "public"."spheroid" OWNER TO "reiser";
ALTER TYPE
SET searc= h_path =3D "sde", pg_catalog;
SET<= /font>
CREATE FUNCTION "st_envelope_in"(c= string) RETURNS st_envelope
 =   LANGUAGE "c" IMMUTABLE STRICT
    AS 'st_geometry', 'ST_ENVELOPE_In';
psql:pg_upgrade_dump_db.sql:371910: ERROR:  duplic= ate key value violates unique constraint "pg_type_oid_index"
DETAIL:  Key (oid)=3D(1407909) already exis= ts.

=
Again, any help that= you could provide would be greatly appreciated. 
John

From: <Reiser>, John Reiser <reiser@rowan.edu>
Date: Wednesday, January 1, 2014 at 11:53 AM
To: "pgsql-general@postgresql.org" <pgsql-general@postgresql.org>
Subject: [GENERAL] duplicate OID issue when= using pg_upgrade to move from 8.4 to 9.2

Hello,

I'm working on an upgrade to our database cluster, attempting to move f= rom 8.4 to 9.2. I'm encountering the following error when I attempt the upg= rade (in pg_upgrade_restore.log):

CREATE FUNCTION "s= t_envelope_in"(cstring) RETURNS st_envelope
    LANGUAGE "c" IMMUTABLE STRICT
    AS 'st_geometry', 'ST_ENVELOPE_In';<= /div>
psql:pg_upgrade_dump_db.sql:371910: ERROR:=  duplicate key value violates unique constraint "pg_type_oid_index"
DETAIL:  Key (oid)=3D(1407909) = already exists.

I'm running this on CentOS 6; both 8.4 and 9.2 are in= stalled from the Yum repository. PostgreSQL is primarily used for GIS data = and has ESRI st_geometry and PostGIS installed in several of the databases.= (ESRI's support is only up to 9.2, which is why I'm not attempting a move to 9.3.) The interesting thing with this error i= s that when I wipe out the 9.2 data directory, re-initdb, and run the upgra= de again, I now get a different error:

CREATE TABLESPACE "sde1" OWNER "sde" LOCATION '/disk2/pgsql/data/= sde';
psql:pg_upgrade_dump_globals= .sql:294: ERROR:  directory "/disk2/pgsql/data/sde/PG_9.2_201204301" a= lready in use as a tablespace

(I have several of our ESRI SDE databases in their own tablespac= e.)

Before starting this process, I made a complet= e file-based backup of the 8.4 data directory. When I restore the backup to= /var/lib/pgsql and run pg_upgrade again, I receive the first error again, = with the same exact OID value. I will admit I don't know much about Postgres internals and I'm not sure how to proceed with this du= plicate OID issue. 

I'm going to try running = pg_upgrade with the link option now, but I don't know if that will help.

Any assistance provided would be greatly appreciated= . 

Thanks,
John

--_000_CEE9B5421D25Areiserrowanedu_--