pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Alvaro Herrera <alvherre@alvh.no-ip.org>
Cc: Mujjamil k <mujjamil995@gmail.com>
Cc: Laurenz Albe <laurenz.albe@cybertec.at>
Cc: pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #18516: Foreign key data integrity is not validated when reenabled the trigger on tables
Date: Thu, 20 Jun 2024 11:50:57 -0400
Message-ID: <354613.1718898657@sss.pgh.pa.us> (raw)
In-Reply-To: <202406201307.ojevjmezqu45@alvherre.pgsql>
References: <202406201307.ojevjmezqu45@alvherre.pgsql>

Alvaro Herrera <alvherre@alvh.no-ip.org> writes:
> I think it's not a bad idea to suggest that we could have a new command
> ALTER TABLE .. DISABLE CONSTRAINT, which can be run by the table owner
> and paired with a later ALTER TABLE ENABLE CONSTRAINT, which verifies
> the constraint.

The existing, supported way to do this is to drop the foreign key
constraint and then later re-create it.

As noted, if you mess with the triggers directly then any subsequent
breakage is your responsibility.

			regards, tom lane





view thread (6+ messages)

Message-ID: <354613.1718898657@sss.pgh.pa.us>
Permalink:  ../354613.1718898657@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/354613.1718898657@sss.pgh.pa.us

 · 

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-bugs@postgresql.org
  Cc: tgl@sss.pgh.pa.us, alvherre@alvh.no-ip.org, mujjamil995@gmail.com, laurenz.albe@cybertec.at, pgsql-bugs@lists.postgresql.org
  Subject: Re: BUG #18516: Foreign key data integrity is not validated when reenabled the trigger on tables
  In-Reply-To: <354613.1718898657@sss.pgh.pa.us>

* 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