How to create a new user in PostgreSQL database?

Solution Verified - Updated -


  • Red Hat Enterprise Linux 5.7


How do I create a new user in PostgreSQL and define specific roles for it?


To create a new user in PostgreSQL you can use the command createuser as described in PostgreSQL 8.4.10 Documentation and to set specific roles you can check the CREATE ROLE command.

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.


Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.