Postgres permissions
From CKAN
These are the default Postgres 8.4 permissions settings (/etc/postgresql/8.4/main/pg_hba.conf):
# Database administrative login by UNIX sockets local all postgres ident # TYPE DATABASE USER CIDR-ADDRESS METHOD # "local" is for Unix domain socket connections only local all all ident # IPv4 local connections: host all all 127.0.0.1/32 md5 # IPv6 local connections: host all all ::1/128 md5
Therefore:
- if you do 'psql -l' then it does a local connection, which uses 'ident' auth, meaning your unix username is your user. You can set the user like this: 'sudo -u postgres psql -l'. But this only works for the superuser and users setup to have the same name as linux users.
- if you do 'psql -h localhost -U postgres -l' then it uses the md5 and you supply the postgres user password (which you will have needed to set).
Superuser account
(See /etc/postgresql/8.4/main/pg_hba.conf)
- This is the only account by default when you install Postgres
- Can be accessed by using 'sudo -u postgres' before the command
- You can also set a password (but of no use with default ident authentication)
$ sudo -u postgres psql postgres postgres=# \password $ psql -U postgres -l