Add macro RelationIsPermanent() to report relation permanence
authorBruce Momjian <bruce@momjian.us>
Tue, 23 Mar 2021 00:22:48 +0000 (20:22 -0400)
committerBruce Momjian <bruce@momjian.us>
Tue, 23 Mar 2021 00:23:52 +0000 (20:23 -0400)
commit95d77149c53545a74e0c84717cf8f925b8f6d632
treec7a2e9f91ac8b42b5c10684edcb597ede25d075d
parent8e4b332e88b8339408a3aa8c62bc93d96b67c808
Add macro RelationIsPermanent() to report relation permanence

Previously, to check relation permanence, the Relation's Form_pg_class
structure member relpersistence was compared to the value
RELPERSISTENCE_PERMANENT ("p"). This commit adds the macro
RelationIsPermanent() and is used in appropirate places to simplify the
code.  This matches other RelationIs* macros.

This macro will be used in more places in future cluster file encryption
patches.

Discussion: http://postgr.es/m/20210318153134.GH20766@tamriel.snowman.net
src/backend/access/gist/gistutil.c
src/backend/access/heap/heapam_handler.c
src/backend/catalog/pg_publication.c
src/backend/commands/tablecmds.c
src/backend/optimizer/util/plancat.c
src/backend/utils/cache/relcache.c
src/include/utils/rel.h
src/include/utils/snapmgr.h