Received: from malur.postgresql.org ([2a02:16a8:dc51::56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fV0T6-00071V-18 for pgsql-admin@arkaria.postgresql.org; Mon, 18 Jun 2018 20:09:40 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1fV0T4-00052Q-9U for pgsql-admin@arkaria.postgresql.org; Mon, 18 Jun 2018 20:09:38 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fV0De-0006Qi-04 for pgsql-admin@lists.postgresql.org; Mon, 18 Jun 2018 19:53:42 +0000 Received: from smtp66.ord1c.emailsrvr.com ([108.166.43.66]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fV0Da-0003ht-6s for pgsql-admin@lists.postgresql.org; Mon, 18 Jun 2018 19:53:41 +0000 Received: from smtp25.relay.ord1c.emailsrvr.com (localhost [127.0.0.1]) by smtp25.relay.ord1c.emailsrvr.com (SMTP Server) with ESMTP id D4B1820426; Mon, 18 Jun 2018 15:53:27 -0400 (EDT) X-SMTPDoctor-Processed: csmtpprox beta Received: from smtp25.relay.ord1c.emailsrvr.com (localhost [127.0.0.1]) by smtp25.relay.ord1c.emailsrvr.com (SMTP Server) with ESMTP id D21C920477; Mon, 18 Jun 2018 15:53:27 -0400 (EDT) Received: from smtp192.mex09.emailsrvr.com (unknown [184.106.73.70]) by smtp25.relay.ord1c.emailsrvr.com (SMTP Server) with ESMTPS id AFEB220426; Mon, 18 Jun 2018 15:53:27 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=imaginesoftware.com; s=20170104; t=1529351607; bh=81jHIaIQBanCmAbAcMJtdMNWaWOaMsiknTKoO8hSih8=; h=From:To:Subject:Date:From; b=jNG3NxMlNfpRWPj5eowgSrCbJjvgrHQYwyvx4UKkl2ZsNsUvBpU/rz9iisvru3N7d xEXOxK6nl3RQx9+61b/eRurUIcO5ImZUl9lJtVmbA5PZj611ECG2JDB60yjMZ9r5+U lojXiIbZGY9dS6OwXR9aFlLC6A5mAy+PCTlumGWs= X-Sender-Id: davidmo@imaginesoftware.com Received: from smtp192.mex09.emailsrvr.com ([UNAVAILABLE]. [184.106.73.70]) (using TLSv1.2 with cipher AES256-GCM-SHA384) by 0.0.0.0:25 (trex/5.7.12); Mon, 18 Jun 2018 15:53:27 -0400 Received: from MBX01D-ORD1.mex09.mlsrvr.com (172.29.128.27) by MBX01C-ORD1.mex09.mlsrvr.com (172.29.128.20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1466.3; Mon, 18 Jun 2018 14:53:27 -0500 Received: from MBX01D-ORD1.mex09.mlsrvr.com ([fe80::c9b1:8c28:1031:4efd]) by MBX01D-ORD1.mex09.mlsrvr.com ([fe80::c9b1:8c28:1031:4efd%21]) with mapi id 15.01.1466.003; Mon, 18 Jun 2018 14:53:27 -0500 From: David Modica To: Tom Lane CC: "pgsql-admin@lists.postgresql.org" Subject: RE: binary upgade errors Thread-Topic: binary upgade errors Thread-Index: AdQD9uZFYcc2bULDSy+FhZmBASKrMgAULQcAAL171rA= Date: Mon, 18 Jun 2018 19:53:26 +0000 Message-ID: <0c70b27484974f60aae44d91101893a0@imaginesoftware.com> References: <7cb957dd12774a52ac8a680b73910c5b@imaginesoftware.com> <10537.1529007868@sss.pgh.pa.us> In-Reply-To: <10537.1529007868@sss.pgh.pa.us> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [4.31.46.200] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk tom, thank you so much for your reply. isn't 0::uint1 casting an int as uint and '0'::uint1 is casting a text as a= uint1 ? not sure why one doesn't require a run time cast and the other doesn't. wou= ld you be able to explain to me ? I am sorry but this casting is new for me. thanks, david -----Original Message----- From: Tom Lane =20 Sent: Thursday, June 14, 2018 4:24 PM To: David Modica Cc: pgsql-admin@lists.postgresql.org Subject: Re: binary upgade errors David Modica writes: > I have been unsuccessfully trying to use pg_upgrade to upgrade from 9.6 t= o 10.4. > we have the uint extension in some of the databases. a combination of=20 > that extension and probably how we have used it is causing the upgrade to= fail. I will include the error msg. > pg_restore: [archiver (db)] Error while PROCESSING TOC: > pg_restore: [archiver (db)] Error from TOC entry 4538; 1247 280489=20 > DOMAIN bool_t postgres > pg_restore: [archiver (db)] could not execute query: ERROR: cannot cast = type integer to public.uint1 > Command was: > -- For binary upgrade, must preserve pg_type oid SELECT=20 > pg_catalog.binary_upgrade_set_next_pg_type_oid('280489'::pg_catalog.oi > d); > CREATE DOMAIN "its"."bool_t" AS "public"."uint1" DEFAULT=20 > (0)::"public"."uint1"; Hmm ... it looks like this domain is depending on there to be a cast from i= nteger to uint1, but that hasn't been created yet. There may be a bug here= ; I'm not sure why pg_dump didn't delay dumping the domain to after it'd du= mped the cast. In the meantime, though, it seems like it would work (and p= robably be faster anyway) if you spelled the default value like '0'::uint1 = rather than 0::uint1, as the former isn't depending on any run-time cast. = So try altering the domain like that and then doing the upgrade. regards, tom lane