diff options
Diffstat (limited to 'src/backend/commands/user.c')
-rw-r--r-- | src/backend/commands/user.c | 21 |
1 files changed, 6 insertions, 15 deletions
diff --git a/src/backend/commands/user.c b/src/backend/commands/user.c index b746982d2ee..4422fadd524 100644 --- a/src/backend/commands/user.c +++ b/src/backend/commands/user.c @@ -433,8 +433,7 @@ CreateRole(ParseState *pstate, CreateRoleStmt *stmt) /* * Insert new record in the pg_authid table */ - roleid = simple_heap_insert(pg_authid_rel, tuple); - CatalogUpdateIndexes(pg_authid_rel, tuple); + roleid = CatalogTupleInsert(pg_authid_rel, tuple); /* * Advance command counter so we can see new record; else tests in @@ -838,10 +837,7 @@ AlterRole(AlterRoleStmt *stmt) new_tuple = heap_modify_tuple(tuple, pg_authid_dsc, new_record, new_record_nulls, new_record_repl); - simple_heap_update(pg_authid_rel, &tuple->t_self, new_tuple); - - /* Update indexes */ - CatalogUpdateIndexes(pg_authid_rel, new_tuple); + CatalogTupleUpdate(pg_authid_rel, &tuple->t_self, new_tuple); InvokeObjectPostAlterHook(AuthIdRelationId, roleid, 0); @@ -1243,9 +1239,7 @@ RenameRole(const char *oldname, const char *newname) } newtuple = heap_modify_tuple(oldtuple, dsc, repl_val, repl_null, repl_repl); - simple_heap_update(rel, &oldtuple->t_self, newtuple); - - CatalogUpdateIndexes(rel, newtuple); + CatalogTupleUpdate(rel, &oldtuple->t_self, newtuple); InvokeObjectPostAlterHook(AuthIdRelationId, roleid, 0); @@ -1530,16 +1524,14 @@ AddRoleMems(const char *rolename, Oid roleid, tuple = heap_modify_tuple(authmem_tuple, pg_authmem_dsc, new_record, new_record_nulls, new_record_repl); - simple_heap_update(pg_authmem_rel, &tuple->t_self, tuple); - CatalogUpdateIndexes(pg_authmem_rel, tuple); + CatalogTupleUpdate(pg_authmem_rel, &tuple->t_self, tuple); ReleaseSysCache(authmem_tuple); } else { tuple = heap_form_tuple(pg_authmem_dsc, new_record, new_record_nulls); - simple_heap_insert(pg_authmem_rel, tuple); - CatalogUpdateIndexes(pg_authmem_rel, tuple); + CatalogTupleInsert(pg_authmem_rel, tuple); } /* CCI after each change, in case there are duplicates in list */ @@ -1647,8 +1639,7 @@ DelRoleMems(const char *rolename, Oid roleid, tuple = heap_modify_tuple(authmem_tuple, pg_authmem_dsc, new_record, new_record_nulls, new_record_repl); - simple_heap_update(pg_authmem_rel, &tuple->t_self, tuple); - CatalogUpdateIndexes(pg_authmem_rel, tuple); + CatalogTupleUpdate(pg_authmem_rel, &tuple->t_self, tuple); } ReleaseSysCache(authmem_tuple); |