pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Álvaro Herrera <alvherre@kurilemu.de>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: SET NOT NULL: Call object-alter hook only after the catalog chan
Date: Fri, 20 Mar 2026 13:42:40 +0000
Message-ID: <E1w3a7b-000eG8-1e@gemulon.postgresql.org> (raw)

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

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/e7975f1c06b585dcda645c6047e6f37cdfacce84

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



view thread (2+ messages)

Message-ID: <E1w3a7b-000eG8-1e@gemulon.postgresql.org>
Permalink:  ../E1w3a7b-000eG8-1e@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1w3a7b-000eG8-1e@gemulon.postgresql.org

 · 

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: pgsql-committers@postgresql.org
  Cc: alvherre@kurilemu.de, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: SET NOT NULL: Call object-alter hook only after the catalog chan
  In-Reply-To: <E1w3a7b-000eG8-1e@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox