mirror of
https://github.com/postgres/postgres.git
synced 2025-11-19 13:42:17 +03:00
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
This commit is contained in:
@@ -45,9 +45,7 @@ check_rel_can_be_partition(Oid relid)
|
||||
relispartition = get_rel_relispartition(relid);
|
||||
|
||||
/* Only allow relation types that can appear in partition trees. */
|
||||
if (!relispartition &&
|
||||
relkind != RELKIND_PARTITIONED_TABLE &&
|
||||
relkind != RELKIND_PARTITIONED_INDEX)
|
||||
if (!relispartition && !RELKIND_HAS_PARTITIONS(relkind))
|
||||
return false;
|
||||
|
||||
return true;
|
||||
@@ -143,8 +141,7 @@ pg_partition_tree(PG_FUNCTION_ARGS)
|
||||
nulls[1] = true;
|
||||
|
||||
/* isleaf */
|
||||
values[2] = BoolGetDatum(relkind != RELKIND_PARTITIONED_TABLE &&
|
||||
relkind != RELKIND_PARTITIONED_INDEX);
|
||||
values[2] = BoolGetDatum(!RELKIND_HAS_PARTITIONS(relkind));
|
||||
|
||||
/* level */
|
||||
if (relid != rootrelid)
|
||||
|
||||
Reference in New Issue
Block a user