BUG #16594: DROP INDEX CONCURRENTLY fails on partitioned table with a non helpful error message. - Mailing list pgsql-bugs

From PG Bug reporting form
Subject BUG #16594: DROP INDEX CONCURRENTLY fails on partitioned table with a non helpful error message.
Date
Msg-id 16594-d2956ca909585067@postgresql.org
Whole thread Raw
Responses Re: BUG #16594: DROP INDEX CONCURRENTLY fails on partitioned table with a non helpful error message.  (Michael Paquier <michael@paquier.xyz>)
List pgsql-bugs
The following bug has been logged on the website:

Bug reference:      16594
Logged by:          Jan Mussler
Email address:      jan.mussler@zalando.de
PostgreSQL version: 12.3
Operating system:   Ubuntu
Description:

Hello everyone,

earlier today we observed a user trying to drop an index concurrently
yielding the following error message:

DROP INDEX CONCURRENTLY IF EXISTS some_idx;
ERROR:  DROP INDEX CONCURRENTLY must be first action in transaction

Continuing down this road the user was asked double check what was going on
and try with a rollback first, yielding the following example output:

=> rollback;
WARNING:  there is no transaction in progress
ROLLBACK
=> DROP INDEX CONCURRENTLY IF EXISTS some_idx;
ERROR:  DROP INDEX CONCURRENTLY must be first action in transaction
=>

After more digging the user elaborated that this is in fact a partitioned
table.

While a person with deeper knowledge may understand that there is more going
on when dropping an index on a partitioned table from a normal user
perspective this error message is confusing.

We have some internal discussion if this is a bug or lack of documentation.
I am siding though with bug believing the otherwise excellent Postgres error
messages can be more helpful here.

Open for feedback and we can also see to contribute to the docs if needed.

-- Jan


pgsql-bugs by date:

Previous
From: Tom Lane
Date:
Subject: Re: ALTER TABLE ALTER COLUMN SET TYPE crash
Next
From: Tom Lane
Date:
Subject: Re: ALTER TABLE ALTER COLUMN SET TYPE crash