Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gn64G-0003sT-QX for pgsql-general@arkaria.postgresql.org; Fri, 25 Jan 2019 18:19:04 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gn64F-0003yu-KH for pgsql-general@arkaria.postgresql.org; Fri, 25 Jan 2019 18:19:03 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gn64F-0003yn-9a for pgsql-general@lists.postgresql.org; Fri, 25 Jan 2019 18:19:03 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gn64D-0000Do-2H for pgsql-general@postgresql.org; Fri, 25 Jan 2019 18:19:02 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id x0PIIuFb002614; Fri, 25 Jan 2019 13:18:56 -0500 From: Tom Lane To: Duarte Carreira cc: "pgsql-general@postgresql.org" Subject: Re: duplicate OID issue when using pg_upgrade to move from 9.3 to 9.5 In-reply-to: References: ,<2957.1548363745@sss.pgh.pa.us> <25393.1548426461@sss.pgh.pa.us> <30594.1548432241@sss.pgh.pa.us> Comments: In-reply-to Duarte Carreira message dated "Fri, 25 Jan 2019 18:02:38 +0000" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <2612.1548440336.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Fri, 25 Jan 2019 13:18:56 -0500 Message-ID: <2613.1548440336@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Duarte Carreira writes: > So I proceeded with the 2 queries: > select pg_describe_object(refclassid,refobjid,refobjsubid), deptype from= pg_depend where objid =3D 'sde.st_envelope'::regtype; > "schema sde";"n" > "function st_envelope_in(cstring)";"n" > "function st_envelope_out(st_envelope)";"n" OK, that looks about like what I'd expect. > select pg_describe_object(classid,objid,objsubid), deptype from pg_depen= d where refobjid =3D 'sde.st_envelope'::regtype; > "type st_envelope[]";"i" > "function st_envelope_union(st_envelope,st_envelope)";"n" > "function st_envelope_union(st_envelope,st_envelope)";"n" > "function st_envelope_union(st_envelope,st_envelope)";"n" > "function st_envelope_intersects(st_envelope,st_envelope)";"n" > "function st_envelope_intersects(st_envelope,st_envelope)";"n" > "function st_envelope_intersects(st_envelope,st_envelope)";"n" > "function st_envelope_equal(st_envelope,st_envelope)";"n" > "function st_envelope_equal(st_envelope,st_envelope)";"n" > "function st_geo_gist_equal(st_envelope,st_envelope,internal)";"n" > "function st_geo_gist_equal(st_envelope,st_envelope,internal)";"n" Ah-hah --- st_envelope_in and st_envelope_out are not mentioned here? That explains your problem. You'd need to add those two rows to pg_depend= , which could go something like insert into pg_depend (classid, objid, objsubid, refclassid, refobjid, refobjsubid, deptype) values ( 'pg_proc'::regclass, 'sde.st_envelope_in(cstring)'::regprocedure, 0, 'pg_type'::regclass, 'sde.st_envelope'::regtype, 0, 'n'); insert into pg_depend (classid, objid, objsubid, refclassid, refobjid, refobjsubid, deptype) values ( 'pg_proc'::regclass, 'sde.st_envelope_out(sde.st_envelope)'::regprocedure, 0, 'pg_type'::regclass, 'sde.st_envelope'::regtype, 0, 'n'); I suppose the evidence about what happened to those rows is long gone, so there's not much point in doing anything but patching things up to the point where you can run pg_upgrade. regards, tom lane