AT detach partition is broken

From: Amit Langote <Langote_Amit_f8(at)lab(dot)ntt(dot)co(dot)jp>
To: Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: AT detach partition is broken
Date: 2017-02-13 07:30:12
Message-ID: 0795d78c-05fe-f625-ac5a-41a0031e967d@lab.ntt.co.jp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

I noticed that running ALTER TABLE table_name DETACH PARTITION crashes, if
table_name is not a partitioned table. That's because of an Assert in
ATExecDetachPartition(). We really should error out much sooner in this
case, IOW during transformAlterTableStmt(), as is done in the case of
ATTACH PARTITION.

Attached patch fixes that.

Thanks,
Amit

Attachment Content-Type Size
0001-Unbreak-ALTER-TABLE-DETACH-PARTITION.patch text/x-diff 4.4 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Masahiko Sawada 2017-02-13 07:31:46 Re: GUC for cleanup indexes threshold.
Previous Message Masahiko Sawada 2017-02-13 07:05:23 Re: DROP SUBSCRIPTION and ROLLBACK