pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Alvaro Herrera <alvherre@alvh.no-ip.org>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: exclusion@gmail.com
Cc: pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #18550: Cross-partition update of a former inheritance parent leads to an assertion failure
Date: Tue, 23 Jul 2024 19:21:12 +0200
Message-ID: <202407231721.772zsh7kjvki@alvherre.pgsql> (raw)
In-Reply-To: <1061674.1721752542@sss.pgh.pa.us>

On 2024-Jul-23, Tom Lane wrote:

> I observe that in the case given, t1 still has pg_class.relhassubclass
> true after the ATTACH PARTITION.  Maybe it'd be wise to force that
> false after verifying there are no subclasses?  (I tried fixing it
> manually, and that prevents the assertion crash.)

Yeah, that seems to work.  We can do that essentially for free in
StorePartitionBound(), like in the attached (which was taken in 14).

I'd add Alexander's script as a test too, somewhere near the bottom of
create_table.sql.


If the affected table is a foreign table, it doesn't seem to have the
same problem (I tried using contrib_regression's ft1 as t1 in
Alexander's script).  I suspect that's because we assume somewhere that
foreign tables are not in turn partitioned.

-- 
Álvaro Herrera        Breisgau, Deutschland  —  https://www.EnterpriseDB.com/

Attachments:

  0001-Reset-relhassubclass-when-attaching-as-a-partition.patch (text/x-diff, 0B) download

view thread (5+ messages)  latest in thread

Message-ID: <202407231721.772zsh7kjvki@alvherre.pgsql>
Permalink:  ../202407231721.772zsh7kjvki@alvherre.pgsql/
Also on:    postgresql.org/message-id/202407231721.772zsh7kjvki@alvherre.pgsql

 ·  · 

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: alvherre@alvh.no-ip.org, tgl@sss.pgh.pa.us, exclusion@gmail.com, pgsql-bugs@lists.postgresql.org
  Subject: Re: BUG #18550: Cross-partition update of a former inheritance parent leads to an assertion failure
  In-Reply-To: <202407231721.772zsh7kjvki@alvherre.pgsql>

* 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