On 2025-Sep-24, jian he wrote:
> currently NOT VALID NOT NULL dumped
> constraint separately, NOT NULL NOT ENFORCED constraints can also be dumped
> separately.
>
> CREATE TABLE tx3 (x int not null not enforced);
>
> can be dumped as:
>
> CREATE TABLE public.tx3 (x integer);
> ALTER TABLE publi
On Thu, Sep 4, 2025 at 8:00 PM Álvaro Herrera wrote:
>
> On 2025-Sep-04, jian he wrote:
>
> > @@ -3093,6 +3115,16 @@ AddRelationNotNullConstraints(Relation rel, List
> > *constraints,
> > conname = other->name;
> >
> > inhcount++
On 04.09.25 17:20, jian he wrote:
On Thu, Sep 4, 2025 at 8:00 PM Álvaro Herrera wrote:
@@ -1272,33 +1294,41 @@ transformTableLikeClause(CreateStmtContext *cxt,
TableLikeClause *table_like_cla
* Reproduce not-null constraints, if any, by copying them. We do this
* regardless
On 2025-Sep-08, jian he wrote:
> set pg_attribute.attnotnull to true for not-valid not-null is still
> useful for INSERT/UPDATE.
> set pg_attribute.attnotnull to true for not-enforced not-null
> constraints doesn't have real benefits, IMHO.
Yeah, you might be right about this actually. What we w
On Thu, Sep 4, 2025 at 8:00 PM Álvaro Herrera wrote:
>
> > @@ -9937,9 +9962,9 @@ ATAddCheckNNConstraint(List **wqueue,
> > AlteredTableInfo *tab, Relation rel,
> >* If adding a valid not-null constraint, set the
> > pg_attribute flag
> >* and tell phase 3 to verif
On 2025-Sep-04, Álvaro Herrera wrote:
> On 2025-Sep-04, jian he wrote:
> > + else if (notenforced)
> > + {
> > + /*
> > +* We can't use ATExecSetNotNull here because it adds
> > an enforced
> > +* not-null constraint,
On Thu, Sep 4, 2025 at 8:00 PM Álvaro Herrera wrote:
>
> > @@ -1272,33 +1294,41 @@ transformTableLikeClause(CreateStmtContext *cxt,
> > TableLikeClause *table_like_cla
> >* Reproduce not-null constraints, if any, by copying them. We do
> > this
> >* regardless of options given.
On 2025-Sep-04, jian he wrote:
> @@ -3093,6 +3115,16 @@ AddRelationNotNullConstraints(Relation rel, List
> *constraints,
> conname = other->name;
>
> inhcount++;
> +
> + /*
> +