Is it me or is PostgreSQL a steaming POS?

her209

No Lifer
Oct 11, 2000
56,336
11
0
Maybe I'm doing something wrong, but all I'm doing is trying to create a user and create a database. WTF!?

On CentOS 4.8, after installing postgresql-server, postgresql, and postgresql-libs, I start the PostgreSQL server (starts fine):
Code:
/etc/init.d/postgresql start
Next I connect:
Code:
su postgres
I create a user that can create databases but not other users (which works):
Code:
createuser -A -d -E -P testuser
I then attempt to create a database as that user (which fails):
Code:
createdb -U testuser -W testdb
Here is the error:
Code:
createdb: could not connect to database template1: FATAL:  IDENT authentication failed for user "testuser"
I've Google'd around and found several people suggesting changing the pg_hba.conf file which I've tried to no avail. I've disabled the iptables firewall completely and still no luck. WTF am I doing wrong? It shouldn't be this hard.
 

her209

No Lifer
Oct 11, 2000
56,336
11
0
After reading document on Client Authentication and some experimenting, I am able to create the database as the specified user in the createdb command by changing the authentication from ident to md5 in the pg_hba.conf file.