pgsql: SET NOT NULL: Call object-alter hook only after the catalog chan

From: Álvaro Herrera <alvherre(at)kurilemu(dot)de>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: SET NOT NULL: Call object-alter hook only after the catalog chan
Date: 2026-03-20 13:42:40
Message-ID: E1w3a7b-000eGA-1m@gemulon.postgresql.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-committers

SET NOT NULL: Call object-alter hook only after the catalog change

... otherwise, the function invoked by the hook might consult the
catalog and not see that the new constraint exists.

This relies on set_attnotnull doing CommandCounterIncrement()
after successfully modifying the catalog.

Oversight in commit 14e87ffa5c54.

Author: Artur Zakirov <zaartur(at)gmail(dot)com>
Backpatch-through: 18
Discussion: https://postgr.es/m/CAKNkYnxUPCJk-3Xe0A3rmCC8B8V8kqVJbYMVN6ySGpjs_qd7dQ@mail.gmail.com

Branch
------
REL_18_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/6958077ceb934f5a0c00f95b673fb86d5a7dde95

Modified Files
--------------
src/backend/commands/tablecmds.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Alexander Korotkov 2026-03-20 13:46:40 pgsql: Fix self-join removal to update bare Var references in join clau
Previous Message Robert Haas 2026-03-20 12:53:59 pgsql: test_plan_advice: Set TAP test priority 50 in meson.build.