Joseph Koshakow <koshy44@gmail.com> writes:
> Is this an intentional decision to not support a binary encoding for
> aclitem types? Or is it just a lack of a feature?
I'm also using binary input/output, and for ACLs, when not using the usual ACL related functions,
I parse them myself, using code inspired from the official sources. Something like below (for DBs in this case).
Assumes you can deal with text arrays in your code of course. I hope that helps. --DD
select ..., coalesce(datacl, acldefault('d', datdba))::text[] as acls,
from pg_database
sv = parseAclName(sv, acl.grantee_);
...
sv = parseAclPrivs(sv, acl.privs_, acl.grantable_);
...
sv = parseAclName(sv, acl.grantor_);
...
}
void parseAcls(const std::vector<std::string>& acls_in, std::vector<AclItem>& acls_out) {
...
for (const std::string& acl : acls_in) {
parseAclItem(acl, acls_out.emplace_back());
}
}