Re: pg_upgrade failure upgrading from v10.8 to v14.4

From: MichaelDBA Vitale <michaeldba(at)sqlexec(dot)com>
To: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>, Murthy Nunna <mnunna(at)fnal(dot)gov>
Cc: "pgsql-admin(at)postgresql(dot)org" <pgsql-admin(at)postgresql(dot)org>
Subject: Re: pg_upgrade failure upgrading from v10.8 to v14.4
Date: 2022-07-22 17:13:01
Message-ID: 1907988893.588756.1658509981368@email.ionos.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

<!doctype html>
<html>
<head>
<meta charset="UTF-8">
</head>
<body>
<div>
Pretty self explanatory...
</div>
<div class="default-style">
&nbsp;
</div>
<div class="default-style">
You have a view that references PG catalog tables whose structure has changed in the new version.&nbsp; Capture the DDL for that view, drop the view, proceed with the upgrade and attempt to create that view in the target DB.&nbsp; PG will give you good error msgs pointing you to what you need to change to get the query to work.
</div>
<div class="default-style">
&nbsp;
</div>
<div class="default-style">
Regards,
</div>
<div class="default-style">
Michael Vitale
</div>
<div class="default-style">
&nbsp;
</div>
<blockquote type="cite">
<div>
On 07/22/2022 12:30 PM EDT David G. Johnston &lt;david(dot)g(dot)johnston(at)gmail(dot)com&gt; wrote:
</div>
<div>
&nbsp;
</div>
<div>
&nbsp;
</div>
<div dir="ltr">
<div dir="ltr">
<div class="gmail_default" style="font-family: arial,helvetica,sans-serif;">
<span style="font-family: Arial,Helvetica,sans-serif;">On Fri, Jul 22, 2022 at 9:19 AM Murthy Nunna &lt;<a href="mailto:mnunna(at)fnal(dot)gov">mnunna(at)fnal(dot)gov</a>&gt; wrote:</span>
</div>
</div>
<div class="gmail_quote">
<blockquote>
<div style="overflow-wrap: break-word;">
<div class="gmail-m_165588171246110865WordSection1">
<p class="MsoNormal">&nbsp;</p>
<p class="MsoNormal"><span style="font-size: 12pt;">I encountered following error. Any help or insight is much appreciated.<u></u><u></u></span></p>
<p class="MsoNormal">&nbsp;</p>
<p class="MsoNormal"><span style="font-size: 12pt;">CREATE VIEW "public"."all_tables" AS<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size: 12pt;">SELECT ((("n"."nspname")::"text" || '.'::"text") || ("c"."relname")::"text") AS "tablename",<u></u><u></u></span></p>
<p class="MsoNormal">&nbsp;</p>
</div>
</div>
</blockquote>
<div>
&nbsp;
</div>
<div class="gmail_default" style="font-family: arial,helvetica,sans-serif;">
You created a view that uses the catalogs and the structure of those catalogs has changed.&nbsp; pg_upgrade cannot fix this for you.&nbsp; Unfortunately, the only real solution is to have a pre-upgrade script that removes the not unusable view, perform the upgrade, and then run a post-upgrade script that replaces it with something that will work in the new system.&nbsp; I'm unaware of a version of PostgreSQL that would act as a transition version where both versions of the view could exist, but you may wish to double-check that if you think such a two-step upgrade path would be easier for you to manage.
</div>
<div class="gmail_default" style="font-family: arial,helvetica,sans-serif;">
&nbsp;
</div>
<div class="gmail_default" style="font-family: arial,helvetica,sans-serif;">
David J.
</div>
<div class="gmail_default" style="font-family: arial,helvetica,sans-serif;">
&nbsp;
</div>
</div>
</div>
</blockquote>
</body>
</html>

Attachment Content-Type Size
unknown_filename text/html 3.1 KB

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Murthy Nunna 2022-07-22 17:23:29 RE: pg_upgrade failure upgrading from v10.8 to v14.4
Previous Message David G. Johnston 2022-07-22 16:30:32 Re: pg_upgrade failure upgrading from v10.8 to v14.4