1 /*-------------------------------------------------------------------------
4 * Commands for manipulating roles (formerly called users).
7 * src/include/commands/user.h
9 *-------------------------------------------------------------------------
14 #include "catalog/objectaddress.h"
15 #include "nodes/parsenodes.h"
16 #include "parser/parse_node.h"
19 /* Hook to check passwords in CreateRole() and AlterRole() */
20 #define PASSWORD_TYPE_PLAINTEXT 0
21 #define PASSWORD_TYPE_MD5 1
23 typedef void (*check_password_hook_type) (const char *username, const char *password, int password_type, Datum validuntil_time, bool validuntil_null);
25 extern PGDLLIMPORT check_password_hook_type check_password_hook;
27 extern Oid CreateRole(ParseState *pstate, CreateRoleStmt *stmt);
28 extern Oid AlterRole(AlterRoleStmt *stmt);
29 extern Oid AlterRoleSet(AlterRoleSetStmt *stmt);
30 extern void DropRole(DropRoleStmt *stmt);
31 extern void GrantRole(GrantRoleStmt *stmt);
32 extern ObjectAddress RenameRole(const char *oldname, const char *newname);
33 extern void DropOwnedObjects(DropOwnedStmt *stmt);
34 extern void ReassignOwnedObjects(ReassignOwnedStmt *stmt);
35 extern List *roleSpecsToIds(List *memberNames);