Rearrange code when managing privileges on tables.

Precisely, I moved the check for cols presence a bit later.

It's safe to exit with ERROR after having append to the string
and it will ease the reading of next commit.
pull/7918/head
Cédric Villemain 2025-03-09 14:39:45 +01:00
parent a7e686c106
commit b634193e00
1 changed files with 4 additions and 4 deletions

View File

@ -90,16 +90,16 @@ PreprocessGrantStmt(Node *node, const char *queryString,
}
isFirst = false;
Assert(priv->priv_name != NULL);
appendStringInfo(&privsString, "%s", priv->priv_name);
if (priv->cols != NIL)
{
ereport(ERROR, (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
errmsg("grant/revoke on column list is currently "
"unsupported")));
}
Assert(priv->priv_name != NULL);
appendStringInfo(&privsString, "%s", priv->priv_name);
}
}