On Thu, Oct 12, 2017 at 7:55 AM, Peter Eisentraut <peter.eisentr...@2ndquadrant.com> wrote: > It seems to me that having ACL_OBJECT_* symbols alongside OBJECT_* > symbols is not useful and leads to duplication. Digging around in the > past suggests that we used to have a lot of these command-specific > symbols but got rid of them over time, except that the ACL stuff was > never touched. The attached patch accomplishes that.
That's always welcome: 14 files changed, 203 insertions(+), 254 deletions(-) This needs an update: $ git grep GrantObjectType src/tools/pgindent/typedefs.list:GrantObjectType -static const char *stringify_grantobjtype(GrantObjectType objtype); -static const char *stringify_adefprivs_objtype(GrantObjectType objtype); +static const char *stringify_grantobjtype(ObjectType objtype); +static const char *stringify_adefprivs_objtype(ObjectType objtype); stringify_grantobjtype should be renamed to stringify_objtype. -bool -EventTriggerSupportsGrantObjectType(GrantObjectType objtype) -{ - switch (objtype) - { - case ACL_OBJECT_DATABASE: - case ACL_OBJECT_TABLESPACE: - /* no support for global objects */ - return false; By removing that, if any GRANT/REVOKE support is added for another object type, then EventTriggerSupportsObjectType would return true by default instead of getting a compilation failure. I think that a comment would be appropriate here: GrantStmt *stmt = (GrantStmt *) parsetree; - if (EventTriggerSupportsGrantObjectType(stmt->objtype)) + if (EventTriggerSupportsObjectType(stmt->objtype)) ProcessUtilitySlow(pstate, pstmt, queryString, Something like, "This checks for more object types than currently supported by the GRANT statement"... Or at least something to outline that risk. -- Michael -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers