]> git.ipfire.org Git - thirdparty/postgresql.git/commit
SET NOT NULL: Call object-alter hook only after the catalog change
authorÁlvaro Herrera <alvherre@kurilemu.de>
Fri, 20 Mar 2026 13:38:50 +0000 (14:38 +0100)
committerÁlvaro Herrera <alvherre@kurilemu.de>
Fri, 20 Mar 2026 13:38:50 +0000 (14:38 +0100)
commit6958077ceb934f5a0c00f95b673fb86d5a7dde95
treed4ade066ee8c1237feec92940c9daef8a20fa4da
parentc11f87b1a3b97d23468bdffd2aba17298f1cb3e0
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@gmail.com>
Backpatch-through: 18
Discussion: https://postgr.es/m/CAKNkYnxUPCJk-3Xe0A3rmCC8B8V8kqVJbYMVN6ySGpjs_qd7dQ@mail.gmail.com
src/backend/commands/tablecmds.c