This creates a new user with the specified username and password for PostgreSQL on a Linux system.

sudo -u postgres psql

CREATE USER <username> WITH PASSWORD '<password>';
GRANT ALL PRIVILEGES ON DATABASE <database> TO <username>;
\q

References: -