Skip to content

Commit

Permalink
PG17 compatibilty: Fix ERROR: unrecognized aclright: 16384
Browse files Browse the repository at this point in the history
Fix `ERROR: unrecognized aclright: 16384`, observed in several tests
(generated_identity, create_single_shard_table, grant_on_sequence_propagation,
grant_on_foreign_server_propagation, single_node_enterprise,
multi_multiuser_master_protocol, multi_alter_table_row_level_security,
shard_move_constraints)

The fix requires updating function `convert_aclright_to_string` in citus_ruleutils.c
to include ACL_MAINTAIN, added the introuduction of MAINTAIN privelege in PG17:
https://git.postgresql.org/gitweb/?p=postgresql.git;a=commitdiff;h=ecb0fd337

Also update `convert_aclright_to_string` to include ACL_SET and
ACL_ALTER_SYSTEM, added by this PG17 commit:
postgres/postgres@a0ffa885e

This keeps `convert_aclright_to_string()` in citus_ruleutils.c
consistent with our currently supported Postgres versions.
  • Loading branch information
colm-mchugh committed Nov 27, 2024
1 parent c396ce6 commit b528f61
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/backend/distributed/deparser/citus_ruleutils.c
Original file line number Diff line number Diff line change
Expand Up @@ -1359,6 +1359,17 @@ convert_aclright_to_string(int aclright)
return "TEMPORARY";
case ACL_CONNECT:
return "CONNECT";
#if PG_VERSION_NUM >= PG_VERSION_15
case ACL_SET:
return "SET";
case ACL_ALTER_SYSTEM:
return "ALTER SYSTEM";

Check warning on line 1366 in src/backend/distributed/deparser/citus_ruleutils.c

View check run for this annotation

Codecov / codecov/patch

src/backend/distributed/deparser/citus_ruleutils.c#L1363-L1366

Added lines #L1363 - L1366 were not covered by tests
#endif

#if PG_VERSION_NUM >= PG_VERSION_17
case ACL_MAINTAIN:
return "MAINTAIN";
#endif
default:
elog(ERROR, "unrecognized aclright: %d", aclright);
return NULL;
Expand Down

0 comments on commit b528f61

Please sign in to comment.