public inbox for [email protected]  
help / color / mirror / Atom feed
From: Cédric Villemain <[email protected]>
To: jian he <[email protected]>
To: 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: Mon, 9 Feb 2026 09:55:00 +0000
Message-ID: <[email protected]> (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>

 > On Mon, Dec 15, 2025 at 7:49 PM Amul Sul <[email protected]> wrote:
>>
>>> v5-0002: alter check constraint enforceability
>>>
>> The patch also looks good, but I have a minor comment for the test --
>> you created the check_constraint_status view, which is not dropped, it
>> should be dropped at the end. Also, instead of a view, I think you
>> could use the \set psql-meta-command; for example, see the
>> init_range_parted or show_data tests in update.sql
>>
>> Also, run pgindent on both patches.
>>
> 
> i have tried using \set, but it seems to require the query within a single line.
> since the view check_constraint_status definition is quite longer, \set would
> make it less readable, so I choose to use view.
> 
> previously I use
> + newcon = (NewConstraint *) palloc0(sizeof(NewConstraint));
> now use
> +        newcon = palloc0_object(NewConstraint);
> 
> v6-0001, v6-0002 both indented properly via pgindent, also polished the commit
> messages.

I have some questions/comments (no change on status, I didn't test)

- FK are constraint triggers, does it makes sense to align 
"ATExecAlterFKConstrEnforceability" renaming with other functions like 
"AlterConstrTriggerDeferrability" ?

- I also wonder if it makes sense to manage NOT NULL together with 
CHECK, like in ATAddCheckNNConstraint.... ?


-- 
Cédric Villemain +33 6 20 30 22 52
https://www.Data-Bene.io
PostgreSQL Support, Expertise, Training, R&D







view thread (2+ messages)

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: <[email protected]>

* 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