diff options
author | Peter Eisentraut | 2021-12-03 12:38:26 +0000 |
---|---|---|
committer | Peter Eisentraut | 2021-12-03 13:08:19 +0000 |
commit | 37b2764593c073ca61c2baebd7d85666e553928b (patch) | |
tree | 56de3f4f9040011f6dd6886adcb5b12a7ae692f8 /contrib/pg_surgery | |
parent | 49422ad0cc88c91a38522b2a7b222c2f2c939f82 (diff) |
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 <[email protected]>
Reviewed-by: Alvaro Herrera <[email protected]>
Discussion: https://www.postgresql.org/message-id/flat/a574c8f1-9c84-93ad-a9e5-65233d6fc00f%40enterprisedb.com
Diffstat (limited to 'contrib/pg_surgery')
-rw-r--r-- | contrib/pg_surgery/heap_surgery.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/contrib/pg_surgery/heap_surgery.c b/contrib/pg_surgery/heap_surgery.c index 7edfe4f326f..f06385e8d3e 100644 --- a/contrib/pg_surgery/heap_surgery.c +++ b/contrib/pg_surgery/heap_surgery.c @@ -103,9 +103,7 @@ heap_force_common(FunctionCallInfo fcinfo, HeapTupleForceOption heap_force_opt) /* * Check target relation. */ - if (rel->rd_rel->relkind != RELKIND_RELATION && - rel->rd_rel->relkind != RELKIND_MATVIEW && - rel->rd_rel->relkind != RELKIND_TOASTVALUE) + if (!RELKIND_HAS_TABLE_AM(rel->rd_rel->relkind)) ereport(ERROR, (errcode(ERRCODE_WRONG_OBJECT_TYPE), errmsg("cannot operate on relation \"%s\"", |