PostgreSQL - Create user & grant permission on a database
Create user & grant permission on a PostgreSQL database
Snippets
CREATEUSERyour_username;ALTERUSER your_username WITH ENCRYPTED PASSWORD 'your_password';CREATE DATABASE your_database_name;// Grant all PRIVILEGESGRANT ALL PRIVILEGES ON DATABASE your_database_name TO your_username;// Grant ReadonlyGRANT SELECT, SHOW VIEW ON `your_database_name`.* TO 'your_username' @ '%';