RE: binary upgade errors

From: David Modica <davidmo(at)imaginesoftware(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: "pgsql-admin(at)lists(dot)postgresql(dot)org" <pgsql-admin(at)lists(dot)postgresql(dot)org>
Subject: RE: binary upgade errors
Date: 2018-06-18 19:53:26
Message-ID: 0c70b27484974f60aae44d91101893a0@imaginesoftware.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

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. would you

be able to explain to me ? I am sorry but this casting is new for me.

thanks,

david

-----Original Message-----
From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Sent: Thursday, June 14, 2018 4:24 PM
To: David Modica <davidmo(at)imaginesoftware(dot)com>
Cc: pgsql-admin(at)lists(dot)postgresql(dot)org
Subject: Re: binary upgade errors

David Modica <davidmo(at)imaginesoftware(dot)com> writes:
> I have been unsuccessfully trying to use pg_upgrade to upgrade from 9.6 to 10.4.
> we have the uint extension in some of the databases. a combination of
> 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
> 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
> pg_catalog.binary_upgrade_set_next_pg_type_oid('280489'::pg_catalog.oi
> d);

> CREATE DOMAIN "its"."bool_t" AS "public"."uint1" DEFAULT
> (0)::"public"."uint1";

Hmm ... it looks like this domain is depending on there to be a cast from integer 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 dumped the cast. In the meantime, though, it seems like it would work (and probably 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

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Tom Lane 2018-06-18 20:10:33 Re: binary upgade errors
Previous Message Keith 2018-06-18 18:27:41 Re: Replication lag from transaction logs