agora inbox for pgsql-bugs@postgresql.org  
help / color / mirror / Atom feed
From: PG Bug reporting form <noreply@postgresql.org>
To: pgsql-bugs@lists.postgresql.org
Cc: exclusion@gmail.com
Subject: BUG #19723: CREATE INDEX racing with ALTER INDEX ATTACH PARTITION triggers unexpected internal error
Date: Sat, 26 Sep 2026 09:00:00 +0000
Message-ID: <19723-8a47b625c2c64f75@postgresql.org> (raw)

The following bug has been logged on the website:

Bug reference:      19723
Logged by:          Alexander Lakhin
Email address:      exclusion@gmail.com
PostgreSQL version: 19beta4
Operating system:   Ubuntu 24.04
Description:        

The following script:
echo "
CREATE TABLE t (a int, b int) PARTITION BY list (b);
CREATE TABLE tp1 PARTITION OF t FOR VALUES IN (1);
" | psql

for ((i=1;i<=100;i++)); do
echo "iteration $i"
echo "
DROP INDEX t_a_idx;
DROP INDEX t_a_idx2;
CREATE INDEX t_a_idx ON ONLY t (a);
CREATE INDEX tp1_a_idx ON tp1 (a);
" | psql

echo "ALTER INDEX t_a_idx ATTACH PARTITION tp1_a_idx;" | psql &
echo "CREATE INDEX t_a_idx2 ON t(a);" | psql
wait
grep 'ERROR:  bogus pg_inherit row' server.log && break;
done

tirggers:
iteration 3
DROP INDEX
DROP INDEX
CREATE INDEX
CREATE INDEX
ERROR:  bogus pg_inherit row: inhrelid 16400 inhparent 16399
ALTER INDEX
2026-09-26 04:36:22.653 EDT|user|regression|6ab78406.1ddce8|XX000 ERROR:
bogus pg_inherit row: inhrelid 16400 inhparent 16399

which is described as unexpected:
                        /*
                         * A pg_inherits row exists.  If it's the same we
want, then we're
                         * good; if it differs, that amounts to a corrupt
catalog and
                         * should not happen.
                         */
                        if (inhForm->inhparent != parentOid)
                        {
                                /* unexpected: we should not get called in
this case */
                                elog(ERROR, "bogus pg_inherit row: inhrelid
%u inhparent %u",
                                         inhForm->inhrelid,
inhForm->inhparent);
                        }

Reproduced starting from 8b08f7d48.








view thread (4+ messages)  latest in thread

Message-ID: <19723-8a47b625c2c64f75@postgresql.org>
Permalink:  ../19723-8a47b625c2c64f75@postgresql.org/
Also on:    postgresql.org/message-id/19723-8a47b625c2c64f75@postgresql.org

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: noreply@postgresql.org, pgsql-bugs@lists.postgresql.org, exclusion@gmail.com
  Subject: Re: BUG #19723: CREATE INDEX racing with ALTER INDEX ATTACH PARTITION triggers unexpected internal error
  In-Reply-To: <19723-8a47b625c2c64f75@postgresql.org>

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

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