public inbox for [email protected]  
help / color / mirror / Atom feed
From: Zsolt Parragi <[email protected]>
To: jian he <[email protected]>
Cc: Amul Sul <[email protected]>
Cc: Robert Treat <[email protected]>
Cc: Kirill Reshke <[email protected]>
Cc: PostgreSQL-development <[email protected]>
Subject: Re: alter check constraint enforceability
Date: Tue, 10 Feb 2026 19:37:41 +0000
Message-ID: <CAN4CZFO+NiypH24M2j1TWo=WeoQN8h60-SESeKJSsCwJJ+2D2g@mail.gmail.com> (raw)
In-Reply-To: <CACJufxFPcaUz5SyqXXNVaV0BvrhZgHFLugdZa6-jzLCciknbJA@mail.gmail.com>
References: <CACJufxHCh_FU-FsEwsCvg9mN6-5tzR6H9ntn+0KUgTCaerDOmg@mail.gmail.com>
	<CACJufxFJFpU0V6zW6nic8_K9NOZqu1g5MOuuSRPTJ9xSAmeNrw@mail.gmail.com>
	<CABV9wwNF45wmhs3gFH7qcyEVQjREQL1y=2ARzLgY__fNT2tWpw@mail.gmail.com>
	<CACJufxFY=GkptsiH8X=VdyYAnNE_=u5j6WyDufTste6CuzRvnw@mail.gmail.com>
	<CALdSSPg7x+zfKaCkq_bBbz7q8nYu93G3-tK+3si_kPwOcnU0iw@mail.gmail.com>
	<CAJSLCQ0rgBK5cgXZzZSHnyBWi95Ngkky8+c1Jf_S0z_x4x6Zrw@mail.gmail.com>
	<CACJufxFsSO7yA0orXwwRROXePeW-qSEOuJbRGHFFZLy8e6pLzA@mail.gmail.com>
	<CAAJ_b975gj8d8djaSxNBcJ+X3Wd_9of-Q3uZm=63SepUiH=2ZQ@mail.gmail.com>
	<CACJufxEDifbBUL6YCUuc0RggKfgbEmUX6t+K-njLxkWBdEdgAg@mail.gmail.com>
	<CAAJ_b95QpTcE6WcbiNUy3Xzs3Bt7MFgofSgQLdzY+B-7cMVyeA@mail.gmail.com>
	<CACJufxFPcaUz5SyqXXNVaV0BvrhZgHFLugdZa6-jzLCciknbJA@mail.gmail.com>

Hello

- if (cmdcon->alterEnforceability &&
- ATExecAlterFKConstrEnforceability(wqueue, cmdcon, conrel, tgrel,
-   currcon->conrelid, currcon->confrelid,
-   contuple, lockmode, InvalidOid,
-   InvalidOid, InvalidOid, InvalidOid))
+ if (cmdcon->alterEnforceability)
+ {
+ if (currcon->contype == CONSTRAINT_FOREIGN)
+ ATExecAlterFKConstrEnforceability(wqueue, cmdcon, conrel, tgrel,
+   currcon->conrelid,
+   currcon->confrelid,
+   contuple, lockmode,
+   InvalidOid, InvalidOid,
+   InvalidOid, InvalidOid);
+ else if (currcon->contype == CONSTRAINT_CHECK)
+ ATExecAlterCheckConstrEnforceability(wqueue, cmdcon, conrel,
+ contuple, recurse, false,
+ lockmode);
  changed = true;

Isn't this a behavior change?

With this change, "changed" is set to true regardless of the return
code of ATExecAlterFKConstrEnforceability (and
ATExecAlterCheckConstrEnforceability). Previously we only set it true
if ATExecAlterFKConstrEnforceability returned true (which means it
actually changed something).

I don't think this is visible anywhere outside the code, but wouldn't
it be better to keep the flag as it was previously?






view thread (3+ messages)  latest in thread

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: [email protected]
  Cc: [email protected], [email protected], [email protected], [email protected], [email protected]
  Subject: Re: alter check constraint enforceability
  In-Reply-To: <CAN4CZFO+NiypH24M2j1TWo=WeoQN8h60-SESeKJSsCwJJ+2D2g@mail.gmail.com>

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

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