Re: Error pg_upgrade version 11 to 15

Nathan Bossart <nathandbossart@gmail.com>

From: Nathan Bossart <nathandbossart@gmail.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Andrew Dunstan <andrew@dunslane.net>, "IVAN HUMANES CABANAS (Fujitsu)" <ivan.humanescabanas@fujitsu.com>, "pgsql-bugs@postgresql.org" <pgsql-bugs@postgresql.org>
Date: 2025-08-18T21:53:50Z
Lists: pgsql-bugs
On Mon, Aug 18, 2025 at 04:18:56PM -0400, Tom Lane wrote:
> Yeah.  The logic about this is in pg_dump, actually: dumpDatabase()
> decides whether or not to add "UPDATE ... SET datistemplate = false"
> to the delQry.  I was thinking about having it do that either if
> the source DB has datistemplate or if its name is template1.
> That would cover both (1) restoring a nonstandard set of databases
> into the original installation with --clean, and (2) restoring a
> nonstandard setup into a pristine installation.  I don't think we
> need to account for template0 because neither pg_dumpall nor
> pg_upgrade will attempt to replace it.
> 
> However, first I'd like confirmation that this theory explains
> the OP's problem.

WFM, provided your theory is correct.

-- 
nathan