On my development (Ubuntu linux) laptop I have a postgres OS account, which owns the Postgres installation.
When I want to perform any postgres activities, create/drop databases etc, I must first su to the postgres account.
$ sudo su postgres
How can I alter my own OS account to have the OS-level privilages of postgres, so I will not need to su ?
Best Answer
Create the user on the OS
Give local users access to postgres
You need to locate the data directory for your postgresql install, i.e. where you have created the database files. They are typically located in /var/lib/pgsql/data The value for your install might be available in the environment variable $PGDATA
if you make any changes, reloading postgres will be necessary
Or as postgres
pg_ctl reload -D ${PGDATA}
Now connect to psql as postgres
Test the connection