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/tablecmds.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/tablecmds.c')
-rw-r--r-- | src/backend/commands/tablecmds.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/src/backend/commands/tablecmds.c b/src/backend/commands/tablecmds.c index c35f09998c4..c8212713069 100644 --- a/src/backend/commands/tablecmds.c +++ b/src/backend/commands/tablecmds.c @@ -916,9 +916,7 @@ DefineRelation(CreateStmt *stmt, char relkind, Oid ownerId, errmsg("specifying a table access method is not supported on a partitioned table"))); } - else if (relkind == RELKIND_RELATION || - relkind == RELKIND_TOASTVALUE || - relkind == RELKIND_MATVIEW) + else if (RELKIND_HAS_TABLE_AM(relkind)) accessMethod = default_table_access_method; /* look up the access method, verify it is for a table */ @@ -13995,9 +13993,7 @@ ATExecSetTableSpace(Oid tableOid, Oid newTableSpace, LOCKMODE lockmode) } else { - Assert(rel->rd_rel->relkind == RELKIND_RELATION || - rel->rd_rel->relkind == RELKIND_MATVIEW || - rel->rd_rel->relkind == RELKIND_TOASTVALUE); + Assert(RELKIND_HAS_TABLE_AM(rel->rd_rel->relkind)); table_relation_copy_data(rel, &newrnode); } |