Hi
Firstly apologies but i have to install an app that uses postgres but i am more a MySQL/Oracle guy so i maybe doing something really wrong here..
I am following instructions for creating a DB user and encountering this
# createuser -ADP -U postgres foo Enter password for new user: Enter it again: createuser: could not connect to database template1: FATAL: IDENT authentication failed for user "postgres"
In a standard postgres install whats causing this? I presume its because the user postgres has a pwd but what is this and why am i not being prompted to enter this?
Thanks and apologies as i know this is not directly a CentOS problem
On Tue, Apr 10, 2007 at 12:03:56PM +0100, Tom Brown wrote:
Try instead: sudo -u postgres createuser -ADP foo
See http://www.postgresql.org/docs/7.4/interactive/client-authentication.html and /var/lib/pgsql/data/pg_hba.conf.
Try instead: sudo -u postgres createuser -ADP foo
Thanks - got further but now i see this
# sudo -u postgres psql -f central.sql -q FOO foo psql: FATAL: IDENT authentication failed for user "foo"
See http://www.postgresql.org/docs/7.4/interactive/client-authentication.html and /var/lib/pgsql/data/pg_hba.conf.
I have looked here and my 'trust' lines look like this
host all all 127.0.0.1 255.255.255.255 trust host all all 192.168.11.238 255.255.255.255 trust
however that issue still occurs - any thoughts?
thanks for the help so far
# sudo -u postgres psql -f central.sql -q FOO foo psql: FATAL: IDENT authentication failed for user "foo"
OK - if i change that line to read
# sudo -u postgres psql -f central.sql -q FOO
that runs fine - So i need to find out from the application people what the difference in those 2 commands is
thanks
On Tue, Apr 10, 2007 at 01:47:56PM +0100, Tom Brown wrote:
The first connects as user foo to the database FOO, while the other connects as the current user (postgres, after sudo).
If you do have a system user foo, you could sudo to it instead of postgres: # sudo -u foo psql -f central.sql -q FOO
You're missing lines for local, as psql uses by default unix sockets (as John Summerfield pointed out): local all all trust
Note that this isn't very secure, as any user in the host can presume to be any other user, so you should change trust to md5 and make sure you have passwords defined for all postgres users.