Don't disallow DROP of constraints ONLY on partitioned tables
authorAlvaro Herrera <[email protected]>
Mon, 30 Sep 2024 09:58:13 +0000 (11:58 +0200)
committerAlvaro Herrera <[email protected]>
Mon, 30 Sep 2024 09:58:13 +0000 (11:58 +0200)
commit4dea33ce765d65d8807d343ca6535a3d067a63da
tree1b93c52362d032b785ec662bf234d198221d0c87
parent4c7cd07aa62abc29e6885e95b5307e5e08bb3bf7
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 <[email protected]>
Discussion: https://postgr.es/m/202409261752[email protected]
Discussion: https://postgr.es/m/7682253a-6f79-6a92-00aa-267c4c412870@lab.ntt.co.jp
(about commit 9139aa19423b, previously not registered)
doc/src/sgml/ref/alter_table.sgml
src/backend/commands/tablecmds.c
src/test/regress/expected/alter_table.out
src/test/regress/sql/alter_table.sql