pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: postgresql@blakeslee.uk
Cc: pgsql-bugs@lists.postgresql.org, Peter Eisentraut <peter.eisentraut@enterprisedb.com>
Subject: Re: BUG #18562: pg_upgrade (14.12 -> 15.7/16.3) fails when schema has unlogged table with logged sequence
Date: Thu, 01 Aug 2024 10:23:04 -0400
Message-ID: <3736990.1722522184@sss.pgh.pa.us> (raw)
In-Reply-To: <18562-46a7ee9a7b1ee153@postgresql.org>
References: <18562-46a7ee9a7b1ee153@postgresql.org>

PG Bug reporting form <noreply@postgresql.org> writes:
> I am seeing a recurring failure when attempting to run pg_upgrade on a 14.12
> database when targeting 15.7 or 16.3.
> I've found this error to occur whenever the schema contains an unlogged
> table with a logged sequence.

Yeah, the way that pg_dump tries to set this situation up is to create
the sequence by using ALTER COLUMN ADD GENERATED, and then change
the sequence's logged-ness.  That cannot work in binary-upgrade mode.

Before we think about alternative ways to dump it though, I wonder
why we permit such a situation at all.  It doesn't seem like a
well-considered bit of database design for an identity sequence's
logged-ness to differ from the owning table's.

The combination of logged table and unlogged sequence is surely a
foot-gun, even if you think there's some value in the other way.
But we allow both.

			regards, tom lane





view thread (2+ messages)

Message-ID: <3736990.1722522184@sss.pgh.pa.us>
Permalink:  ../3736990.1722522184@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/3736990.1722522184@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-bugs@postgresql.org
  Cc: tgl@sss.pgh.pa.us, postgresql@blakeslee.uk, peter.eisentraut@enterprisedb.com
  Subject: Re: BUG #18562: pg_upgrade (14.12 -> 15.7/16.3) fails when schema has unlogged table with logged sequence
  In-Reply-To: <3736990.1722522184@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox