BUG #16594: DROP INDEX CONCURRENTLY fails on partitioned table with a non helpful error message.

From: PG Bug reporting form <noreply(at)postgresql(dot)org>
To: pgsql-bugs(at)lists(dot)postgresql(dot)org
Cc: jan(dot)mussler(at)zalando(dot)de
Subject: BUG #16594: DROP INDEX CONCURRENTLY fails on partitioned table with a non helpful error message.
Date: 2020-08-26 20:11:16
Message-ID: 16594-d2956ca909585067@postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

The following bug has been logged on the website:

Bug reference: 16594
Logged by: Jan Mussler
Email address: jan(dot)mussler(at)zalando(dot)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

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2020-08-26 20:25:08 Re: ALTER TABLE ALTER COLUMN SET TYPE crash
Previous Message Tom Lane 2020-08-26 12:00:49 Re: ALTER TABLE ALTER COLUMN SET TYPE crash