Don't disallow DROP of constraints ONLY on partitioned tables
Alvaro Herrera <alvherre@alvh.no-ip.org>
Don't disallow DROP of constraints ONLY on partitioned tables This restriction seems to have come about due to some fuzzy thinking: in commit 9139aa19423b we were adding a restriction against ADD constraint ONLY on partitioned tables (which is sensible) and apparently we thought the DROP case had to be symmetrical. However, it isn't, and the comments about it are mistaken about the effect it would have. Remove this limitation. There have been no reports of users bothered by this limitation, so I'm not backpatching it just yet. We can revisit this decision later, as needed. Reviewed-by: Amit Langote <amitlangote09@gmail.com> Discussion: https://postgr.es/m/202409261752.nbvlawkxsttf@alvherre.pgsql Discussion: https://postgr.es/m/7682253a-6f79-6a92-00aa-267c4c412870@lab.ntt.co.jp (about commit 9139aa19423b, previously not registered)
Files
| Path | Change | +/− |
|---|---|---|
| doc/src/sgml/ref/alter_table.sgml | modified | +3 −1 |
| src/backend/commands/tablecmds.c | modified | +1 −37 |
| src/test/regress/expected/alter_table.out | modified | +14 −7 |
| src/test/regress/sql/alter_table.sql | modified | +4 −3 |
Documentation touched
Discussion
- ALTER TABLE ONLY .. DROP CONSTRAINT on partitioned tables 4 messages · 2024-09-26 → 2024-10-10
- pg_dump emits ALTER TABLE ONLY partitioned_table 64 messages · 2017-02-17 → 2018-12-11