aboutsummaryrefslogtreecommitdiff
path: root/src/backend/commands/tablecmds.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/backend/commands/tablecmds.c')
-rw-r--r--src/backend/commands/tablecmds.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/backend/commands/tablecmds.c b/src/backend/commands/tablecmds.c
index 70b94bbb397..8d7c68b8b3c 100644
--- a/src/backend/commands/tablecmds.c
+++ b/src/backend/commands/tablecmds.c
@@ -2097,7 +2097,7 @@ ExecuteTruncateGuts(List *explicit_rels,
* Assemble an array of relids so we can write a single WAL record for the
* whole action.
*/
- if (list_length(relids_logged) > 0)
+ if (relids_logged != NIL)
{
xl_heap_truncate xlrec;
int i = 0;
@@ -16264,11 +16264,11 @@ ATPrepChangePersistence(Relation rel, bool toLogged)
}
/*
- * Check that the table is not part any publication when changing to
- * UNLOGGED as UNLOGGED tables can't be published.
+ * Check that the table is not part of any publication when changing to
+ * UNLOGGED, as UNLOGGED tables can't be published.
*/
if (!toLogged &&
- list_length(GetRelationPublications(RelationGetRelid(rel))) > 0)
+ GetRelationPublications(RelationGetRelid(rel)) != NIL)
ereport(ERROR,
(errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
errmsg("cannot change table \"%s\" to unlogged because it is part of a publication",