On 2025/07/03 0:31, Álvaro Herrera wrote:
On 2025-Jul-02, Fujii Masao wrote:

Regarding the 0003 patch:

+                                       if (($11 & CAS_NOT_ENFORCED) != 0)
+                                               ereport(ERROR,
+                                                               errmsg("constraint 
triggers cannot be marked %s",
+                                                                          "NOT 
ENFORCED"),
+                                                               
parser_errposition(@11));

Shouldn't we also raise an error when CAS_ENFORCED is given?

Great point -- ENFORCED can also throw the bogus error.  However, if you
say ENFORCED, the constraint is going to be enforced, which is the same
that happens if you don't say anything, so I think we should accept the
case.  So how about this?

Yeah, this approach works for me. TBH I'm fine with either way.

If we go with it, I’m slightly inclined to add [ ENFORCED ] to
the CREATE TRIGGER syntax in the docs. Without that, users might be confused
or raise concerns that CREATE CONSTRAINT TRIGGER accepts an option
(i.e., ENFORCED) that isn't actually documented in the syntax.
But if you think this is overkill, I'm ok not to update the syntax in the docs.

Regards,

--
Fujii Masao
NTT DATA Japan Corporation



Reply via email to