Penguin
Note: You are viewing an old revision of this page. View the current version.

IDENT authentication failed for user

PostgreSQL under Debian by default uses IDENT authentication to authenticate a user connecting to the database. In english this means that you can only connect to the database with the same username as your unix login. This can be edited in /etc/postgres/pg_hba.conf (Host Based Authentication) by changing ident sameuser with trust to let anyone connect to the database with any username without a password, or crypt etc. The file is well commented, refer to it for more details.

If you change Debian's default setup, then you may get error messages every day from cron, as the postgres user connects to every database and runs some optimisations.

The Unix SuperUser can change to the postgres user to run the shell commands createdb and createuser -- if you create a database user with the same name as a Unix account, then that Unix account user can connect (when using ident sameuser). If you don't want to use the shell command, the postgres user could run psql template1 to connect via the interactive shell, and then do create database name; or create user name;.

Upgrading from 7.2 to 7.3

Check your pg_hba.conf file. Previously "password" authentication covered all forms of stored password. Now it is strict. If you are using MD5 passwords, it must be MD5.

Also, in SQL-land, LIMIT used to be fairly forgiving about its arguments. It would accept MySQL format without blinking. Now it's strict.

Finally, if you are a Debian user, don't believe the instructions in the update README! psql -e < dumpfile will not restore your database... you need to do psql template1 -e dumpfile.

"You should create PGDATA directory first." in GentooLinux? after an emerge install

If you get the following error:

# /etc/init.d/postgresql start
 * directory not found: /var/lib/postgresql/data
 * You should create PGDATA directory first.

then you need to issue ebuild /var/db/pkg/dev-db/postgresql-<VERSION>/postgresql-<VERSION>.ebuild config