Re: Order of InvokeObjectPostAlterHook within ATExecSetNotNull

From: Álvaro Herrera <alvherre(at)kurilemu(dot)de>
To: Artur Zakirov <zaartur(at)gmail(dot)com>
Cc: Postgres hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Order of InvokeObjectPostAlterHook within ATExecSetNotNull
Date: 2026-03-18 16:34:36
Message-ID: 202603181633.32bikq5m7kh6@alvherre.pgsql
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2026-Mar-18, Artur Zakirov wrote:

> Hello hackers!
>
> The commit 14e87ff added pg_constraint rows for not-null [1]. The
> consequence of the patch is that it changed the order of
> InvokeObjectPostAlterHook() call and update of "attnotnull" field in
> the catalog. Before the update was before the call of the hook [2].
> And now "attnotnull" is updated after the call of
> InvokeObjectPostAlterHook() [3].
>
> This is a noticeable change to extensions which use
> "object_access_hook" since they see a bit of stale information about
> the attribute.
>
> Is this an intended behavior or rather a bug?

This was not intentional. Want to submit a patch?

--
Álvaro Herrera 48°01'N 7°57'E — https://www.EnterpriseDB.com/

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Masahiko Sawada 2026-03-18 16:44:46 Re: Initial COPY of Logical Replication is too slow
Previous Message Tom Lane 2026-03-18 16:23:51 Re: Use SIGTERM instead of SIGUSR1 for slotsync worker to exit during promotion?