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