diff options
author | Peter Eisentraut <peter@eisentraut.org> | 2021-12-03 13:38:26 +0100 |
---|---|---|
committer | Peter Eisentraut <peter@eisentraut.org> | 2021-12-03 14:08:19 +0100 |
commit | 37b2764593c073ca61c2baebd7d85666e553928b (patch) | |
tree | 56de3f4f9040011f6dd6886adcb5b12a7ae692f8 /src/backend/commands/indexcmds.c | |
parent | 49422ad0cc88c91a38522b2a7b222c2f2c939f82 (diff) | |
download | postgresql-37b2764593c073ca61c2baebd7d85666e553928b.tar.gz postgresql-37b2764593c073ca61c2baebd7d85666e553928b.zip |
Some RELKIND macro refactoring
Add more macros to group some RELKIND_* macros:
- RELKIND_HAS_PARTITIONS()
- RELKIND_HAS_TABLESPACE()
- RELKIND_HAS_TABLE_AM()
Reviewed-by: Michael Paquier <michael@paquier.xyz>
Reviewed-by: Alvaro Herrera <alvherre@alvh.no-ip.org>
Discussion: https://www.postgresql.org/message-id/flat/a574c8f1-9c84-93ad-a9e5-65233d6fc00f%40enterprisedb.com
Diffstat (limited to 'src/backend/commands/indexcmds.c')
-rw-r--r-- | src/backend/commands/indexcmds.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c index c14ca27c5ed..8d3104821ee 100644 --- a/src/backend/commands/indexcmds.c +++ b/src/backend/commands/indexcmds.c @@ -2954,8 +2954,7 @@ reindex_error_callback(void *arg) { ReindexErrorInfo *errinfo = (ReindexErrorInfo *) arg; - Assert(errinfo->relkind == RELKIND_PARTITIONED_INDEX || - errinfo->relkind == RELKIND_PARTITIONED_TABLE); + Assert(RELKIND_HAS_PARTITIONS(errinfo->relkind)); if (errinfo->relkind == RELKIND_PARTITIONED_TABLE) errcontext("while reindexing partitioned table \"%s.%s\"", @@ -2984,8 +2983,7 @@ ReindexPartitions(Oid relid, ReindexParams *params, bool isTopLevel) ErrorContextCallback errcallback; ReindexErrorInfo errinfo; - Assert(relkind == RELKIND_PARTITIONED_INDEX || - relkind == RELKIND_PARTITIONED_TABLE); + Assert(RELKIND_HAS_PARTITIONS(relkind)); /* * Check if this runs in a transaction block, with an error callback to @@ -3118,8 +3116,7 @@ ReindexMultipleInternal(List *relids, ReindexParams *params) * Partitioned tables and indexes can never be processed directly, and * a list of their leaves should be built first. */ - Assert(relkind != RELKIND_PARTITIONED_INDEX && - relkind != RELKIND_PARTITIONED_TABLE); + Assert(!RELKIND_HAS_PARTITIONS(relkind)); if ((params->options & REINDEXOPT_CONCURRENTLY) != 0 && relpersistence != RELPERSISTENCE_TEMP) |