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

From Nathan Bossart
Subject Re: bogus error message for ALTER TABLE ALTER CONSTRAINT
Date
Msg-id Z8dIJaGJibtA0l7J@nathan
Whole thread Raw
In response to bogus error message for ALTER TABLE ALTER CONSTRAINT  (Álvaro Herrera <alvherre@alvh.no-ip.org>)
Responses Re: bogus error message for ALTER TABLE ALTER CONSTRAINT
List pgsql-hackers
On Tue, Mar 04, 2025 at 07:22:22PM +0100, Álvaro Herrera wrote:
> 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.

LGTM

-- 
nathan



pgsql-hackers by date:

Previous
From: Álvaro Herrera
Date:
Subject: bogus error message for ALTER TABLE ALTER CONSTRAINT
Next
From: Jeff Davis
Date:
Subject: Re: making EXPLAIN extensible