pgsql: Add an assertion in get_object_address()

From: Peter Eisentraut <peter(at)eisentraut(dot)org>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Add an assertion in get_object_address()
Date: 2024-11-15 08:03:07
Message-ID: E1tBrIJ-001uFf-D6@gemulon.postgresql.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Add an assertion in get_object_address()

Some places declared a Relation before calling get_object_address()
only to assert that the relation is NULL after the call.

The new assertion allows passing NULL as the relation argument at
those places making the code cleaner and easier to understand.

Author: Bertrand Drouvot <bertranddrouvot(dot)pg(at)gmail(dot)com>
Discussion: https://www.postgresql.org/message-id/ZzG34eNrT83W/Orz(at)ip-10-97-1-34(dot)eu-west-3(dot)compute(dot)internal

Branch
------
master

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

Modified Files
--------------
src/backend/catalog/objectaddress.c | 9 +++++++--
src/backend/commands/alter.c | 15 ++++-----------
2 files changed, 11 insertions(+), 13 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Heikki Linnakangas 2024-11-15 08:09:40 pgsql: jit: Stop emitting some unnecessary instructions
Previous Message Michael Paquier 2024-11-15 02:33:15 pgsql: Fix race conditions with drop of reused pgstats entries