Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1VyPJQ-00070y-6H for pgsql-general@arkaria.postgresql.org; Wed, 01 Jan 2014 17:10:32 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1VyPJP-0001NL-Kw for pgsql-general@arkaria.postgresql.org; Wed, 01 Jan 2014 17:10:31 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1VyPJN-0001Lm-UY for pgsql-general@postgresql.org; Wed, 01 Jan 2014 17:10:30 +0000 Received: from mail-pb0-x22d.google.com ([2607:f8b0:400e:c01::22d]) by magus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1VyPJK-0001oL-GM for pgsql-general@postgresql.org; Wed, 01 Jan 2014 17:10:29 +0000 Received: by mail-pb0-f45.google.com with SMTP id rp16so13643348pbb.4 for ; Wed, 01 Jan 2014 09:10:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding; bh=3X9nDt8CAi/dMYAdxtT8II+XvL4YE8QZ4nvsorSErBo=; b=nPgobT9gos9aeyLEGNt5UHurmMiDvHj8JPu0FUYvgKpZvIJByRU7KenIfB1GgrN7fy L3Ja1GBBlrTNUCl4cCvvChLJSBqLZwpKll7p7me7kEWgoOvHl0rwZ4jfF1xz7URC2QmX RoF+11qvMcDvG1FJU9ktxgiiPSgNJKtgPwo27UuBZ04i/iESVSWa+Pbo7BccLFjRT9jI Cdx3kOnFDL7gSS7MJVJqbH4AjKjm2zBNRCPv2XSBL2aXQCisIqbdK6Wd4I8TJERws2Db D9aiAYiXqQEnAjeDAIFXvV/n2wKp1FQDk5od2GlpIiHvvqTYjKcoC5KlrGq5r3m8WprF uedA== X-Received: by 10.66.139.196 with SMTP id ra4mr84313172pab.103.1388596224429; Wed, 01 Jan 2014 09:10:24 -0800 (PST) Received: from panda.site (174-21-132-251.tukw.qwest.net. [174.21.132.251]) by mx.google.com with ESMTPSA id ha10sm96220922pbd.17.2014.01.01.09.10.22 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 01 Jan 2014 09:10:23 -0800 (PST) Message-ID: <52C44BFC.7020301@gmail.com> Date: Wed, 01 Jan 2014 09:10:20 -0800 From: Adrian Klaver User-Agent: Mozilla/5.0 (X11; Linux i686; rv:24.0) Gecko/20100101 Thunderbird/24.2.0 MIME-Version: 1.0 To: pgsql-general@postgresql.org Subject: Re: duplicate OID issue when using pg_upgrade to move from 8.4 to 9.2 References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: -2.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 On 01/01/2014 08:53 AM, Reiser, John J. wrote: > 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 unique constraint "pg_type_oid_index" > DETAIL: Key (oid)=() already exists. Well this means an OID is being used twice in the system catalog pg_type. You could look up that oid(1407909) in the 8.4 pg_type and see what it is. Also look it up in the fresh pg_type when you init the 9.2 cluster. > > I'm running this on CentOS 6; both 8.4 and 9.2 are installed 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 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 When you ran the upgrade above it probably got as far as creating the 9.2 tablespaces in /disk2/pgsql/data/sde. You now have two versions of the tablespaces, one labeled PG_8.4_* and the other PG_9.2_201204301. Along with wiping out the 9.2 data directory you need to wipe out the 9.2 tablespace directory. > > > (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_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 duplicate 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 > > John Reiser > > /Geospatial Research Lab / > > *Rowan University * > > 201 Mullica Hill Road > > Glassboro, NJ 08028 > > phone: 856-256-4817 > > cell: 856-347-0047 > > twitter: @rowangeolab > -- Adrian Klaver adrian.klaver@gmail.com -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general