user.h 1.2 KB

123456789101112131415161718192021222324252627282930313233343536
  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. #include "catalog/objectaddress.h"
  14. #include "nodes/parsenodes.h"
  15. /* Hook to check passwords in CreateRole() and AlterRole() */
  16. #define PASSWORD_TYPE_PLAINTEXT 0
  17. #define PASSWORD_TYPE_MD5 1
  18. typedef void (*check_password_hook_type) (const char *username, const char *password, int password_type, Datum validuntil_time, bool validuntil_null);
  19. extern PGDLLIMPORT check_password_hook_type check_password_hook;
  20. extern Oid CreateRole(CreateRoleStmt *stmt);
  21. extern Oid AlterRole(AlterRoleStmt *stmt);
  22. extern Oid AlterRoleSet(AlterRoleSetStmt *stmt);
  23. extern void DropRole(DropRoleStmt *stmt);
  24. extern void GrantRole(GrantRoleStmt *stmt);
  25. extern ObjectAddress RenameRole(const char *oldname, const char *newname);
  26. extern void DropOwnedObjects(DropOwnedStmt *stmt);
  27. extern void ReassignOwnedObjects(ReassignOwnedStmt *stmt);
  28. extern List *roleSpecsToIds(List *memberNames);
  29. #endif /* USER_H */