BUG #19723: CREATE INDEX racing with ALTER INDEX ATTACH PARTITION triggers unexpected internal error - Mailing list pgsql-bugs

From PG Bug reporting form
Subject BUG #19723: CREATE INDEX racing with ALTER INDEX ATTACH PARTITION triggers unexpected internal error
Date
Msg-id 19723-8a47b625c2c64f75@postgresql.org
Whole thread
Responses Re: BUG #19723: CREATE INDEX racing with ALTER INDEX ATTACH PARTITION triggers unexpected internal error
List pgsql-bugs
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.





pgsql-bugs by date:

Previous
From: PG Bug reporting form
Date:
Subject: BUG #19722: Window PARTITION BY numeric treats equal values with different scales as separate partitions
Next
From: Kirill Reshke
Date:
Subject: Re: BUG #19720: pg_trgm GiST index corruption from gtrgm_union() dropping SIGNKEY