PostgreSQL Installation and Setup
When installing PostgreSQL a root user named postgresql will be created. But you, not being that user, how can you access the database? How can you use it as a client user?
Some simple steps (client username will be un):via
As root (use su to change to root if you are not), change to postgresql user:su - postgres
Connect to pqsql and to the template1 database:psql template1
Create the user role:CREATE USER tom WITH PASSWORD 'myPassword';
Create a database:CREATE DATABASE testdb;
Grant privileges:
>GRANT ALL PRIVILEGES ON DATABASE jerry TO tom;
Done.\q
Test with:psql -d un -U tom