Add an assertion in get_object_address()

Peter Eisentraut <peter@eisentraut.org>

Commit: e468ec0fddcd93e282da6685b75d5687c2a87f2a
Author: Peter Eisentraut <peter@eisentraut.org>
Date: 2024-11-15T07:52:43Z
Releases: 18.0
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.pg@gmail.com>
Discussion: https://www.postgresql.org/message-id/ZzG34eNrT83W/Orz@ip-10-97-1-34.eu-west-3.compute.internal

Files

PathChange+/−
src/backend/catalog/objectaddress.c modified +7 −2
src/backend/commands/alter.c modified +4 −11

Discussion