1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-07 00:36:50 +03:00

Code beautification for object-access hook machinery.

KaiGai Kohei
This commit is contained in:
Robert Haas
2013-03-06 20:52:06 -05:00
parent f11af2bcab
commit f90cc26982
29 changed files with 123 additions and 119 deletions

View File

@ -426,8 +426,7 @@ CreateRole(CreateRoleStmt *stmt)
GetUserId(), false);
/* Post creation hook for new role */
InvokeObjectAccessHook(OAT_POST_CREATE,
AuthIdRelationId, roleid, 0, NULL);
InvokeObjectPostCreateHook(AuthIdRelationId, roleid, 0);
/*
* Close pg_authid, but keep lock till commit.
@ -968,14 +967,7 @@ DropRole(DropRoleStmt *stmt)
errmsg("must be superuser to drop superusers")));
/* DROP hook for the role being removed */
if (object_access_hook)
{
ObjectAccessDrop drop_arg;
memset(&drop_arg, 0, sizeof(ObjectAccessDrop));
InvokeObjectAccessHook(OAT_DROP,
AuthIdRelationId, roleid, 0, &drop_arg);
}
InvokeObjectDropHook(AuthIdRelationId, roleid, 0);
/*
* Lock the role, so nobody can add dependencies to her while we drop