pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Nathan Bossart <nathandbossart@gmail.com>
To: Álvaro Herrera <alvherre@alvh.no-ip.org>
Cc: Pg Hackers <pgsql-hackers@lists.postgresql.org>
Subject: Re: bogus error message for ALTER TABLE ALTER CONSTRAINT
Date: Tue, 4 Mar 2025 12:36:21 -0600
Message-ID: <Z8dIJaGJibtA0l7J@nathan> (raw)
In-Reply-To: <202503041822.aobpqke3igvb@alvherre.pgsql>
References: <202503041822.aobpqke3igvb@alvherre.pgsql>

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





view thread (14+ messages)  latest in thread

Message-ID: <Z8dIJaGJibtA0l7J@nathan>
Permalink:  ../Z8dIJaGJibtA0l7J@nathan/
Also on:    postgresql.org/message-id/Z8dIJaGJibtA0l7J@nathan

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-hackers@postgresql.org
  Cc: nathandbossart@gmail.com, alvherre@alvh.no-ip.org, pgsql-hackers@lists.postgresql.org
  Subject: Re: bogus error message for ALTER TABLE ALTER CONSTRAINT
  In-Reply-To: <Z8dIJaGJibtA0l7J@nathan>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox