08 July 2010

Authentication failed

If you can't connect to postgres with the psql command (this happens, for example, with Ubuntu 9.10 and postgres 8.3):
$ psql -W gis username
psql: FATAL:  Ident authentication failed for user "username"
Even after you've set the password for the user:
$ sudo -u postgres -s -H
postgres@aoeu$ psql 
Welcome to psql 8.3.5, the PostgreSQL interactive terminal.
ALTER ROLE username PASSWORD 'mypassword';
You may have to append the following lines to your pg_hba.conf (found e.g. in /etc/postgresql/8.3/main):
local   all         all                               trust   
host    all         all          trust
host    all         all         ::1/128               trust
So that you can use password authentication from localhost.
Note that you may have to comment out any existing lines beginning with local all or host all. I had to comment out the following section on Ubuntu 8.40:
# "local" is for Unix domain socket connections only 
#local   all         all                               ident sameuser
# IPv4 local connections:
#host    all         all          md5
# IPv6 local connections:
#host    all         all         ::1/128               md5


Xiaoyu Guan (Sam)

06 July 2010

step 1: install postgresql 8.4 with postgis 1.3 via synaptic package manager
step 2: open root terminal,
run sudo su postgres -c psql postgres
then alter user with password 'YOURPASSOWRD';

step 3: open your pgadminIII, with postgres account.
 postgresql is ready for you now.

Xiaoyu Guan (Sam)