bogus error message for ALTER TABLE ALTER CONSTRAINT
Alvaro Herrera <alvherre@alvh.no-ip.org>
From: Álvaro Herrera <alvherre@alvh.no-ip.org>
To: Pg Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2025-03-04T18:22:22Z
Lists: pgsql-hackers
Attachments
- 0001-Fix-ALTER-TABLE-error-message.patch (text/x-diff)
I just discovered that trying to set a foreign key as NO INHERIT in ALTER TABLE ALTER CONSTRAINT returns an absurd error message: create table pk (a int primary key); create table fk (a int references pk); alter table fk alter constraint fk_a_fkey deferrable, alter constraint fk_a_fkey no inherit; ERROR: ALTER CONSTRAINT statement constraints cannot be marked NO INHERIT The explanation is that somebody misunderstood what must be given to processCASbits in 2013. The intended message is: ERROR: FOREIGN KEY constraints cannot be marked NO INHERIT Here's the fix along with some additional cleanup. -- Álvaro Herrera Breisgau, Deutschland — https://www.EnterpriseDB.com/
Commits
-
Fix bogus grammar for a CREATE CONSTRAINT TRIGGER error
- 87251e114967 19 (unreleased) landed
-
Fix ALTER TABLE error message
- bf1e2d2db510 15.13 landed
- 9ea5fe5b6c80 16.9 landed
- 931a1c023790 14.18 landed
- 7bbc46213de9 18.0 landed
- 4e026be5f159 17.5 landed
- 0f354e0805ed 13.21 landed