bogus error message for ALTER TABLE ALTER CONSTRAINT - Mailing list pgsql-hackers

From Álvaro Herrera
Subject bogus error message for ALTER TABLE ALTER CONSTRAINT
Date
Msg-id 202503041822.aobpqke3igvb@alvherre.pgsql
Whole thread Raw
Responses Re: bogus error message for ALTER TABLE ALTER CONSTRAINT
Re: bogus error message for ALTER TABLE ALTER CONSTRAINT
List pgsql-hackers
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/

Attachment

pgsql-hackers by date:

Previous
From: Heikki Linnakangas
Date:
Subject: Rename some signal and interrupt handling functions for consistency
Next
From: Nathan Bossart
Date:
Subject: Re: bogus error message for ALTER TABLE ALTER CONSTRAINT