pgsql: Use heap_inplace_update() to unset pg_database.dathasloginevt

From: Alexander Korotkov <akorotkov(at)postgresql(dot)org>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Use heap_inplace_update() to unset pg_database.dathasloginevt
Date: 2024-02-11 22:52:37
Message-ID: E1rZIgf-005kYP-65@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Use heap_inplace_update() to unset pg_database.dathasloginevt

Doing this instead of regular updates serves two purposes. First, that avoids
possible waiting on the row-level lock. Second, that avoids dealing with
TOAST.

It's known that changes made by heap_inplace_update() may be lost due to
concurrent normal updates. However, we are OK with that. The subsequent
connections will still have a chance to set "dathasloginevt" to false.

Reported-by: Alexander Lakhin
Discussion: https://postgr.es/m/e2a0248e-5f32-af0c-9832-a90d303c2c61%40gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/8be93177c46b0f6a29a7376229b7ee002066d5f8

Modified Files
--------------
src/backend/commands/event_trigger.c | 36 ++++++++++++++++++++++++++++++++----
1 file changed, 32 insertions(+), 4 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Heikki Linnakangas 2024-02-12 09:13:20 pgsql: Remove unnecessary smgropen() calls
Previous Message Peter Eisentraut 2024-02-11 22:44:04 pgsql: Remove obsolete script related to MSVC build system