Thread: postgres access - pg_hba.conf

postgres access - pg_hba.conf

From
"bruce"
Date:
Hi..

I'm trying to setup an app (gforge) to communicate using the postgres db.

I've modified the pg_hba.conf file and I can sort of get access. However, it
appears that I can't access the database using a passwd. I assume I'm using
the wrong passwd, although I created the db, and thought that this was the
passwd for the db! Is there a way to change the passwd? I have root access
to the system, but I'm not a postgres dba...

I have the following pg_hba.conf file:
 # GFORGE5
 #local all all trust
 local all all md5
 # IPv4 local connections:
 host    all         all         127.0.0.1    255.255.255.255  md5
 #host    all         all         127.0.0.1    255.255.255.255  trust


I type the following:
  [root@lserver2 ~]# psql -d gforge -U gforge -h 127.0.0.1 -W gforge
  psql: warning: extra command-line argument "gforge" ignored
  Password for user gforge:

I get:
  psql: FATAL:  password authentication failed for user "gforge"


Any thoughts/etc...
Basically, it looks like I need to know how to create a database, with a
user/dbname/db address/passwd so the pg_hba.conf works correctly...

(If i leave out the md5, and use the "trust" then I can access the db
without a passwd, but that's not what I need.)

thanks

-bruce
bedouglas@earthlink.net


Re: postgres access - pg_hba.conf

From
Andrew Sullivan
Date:
On Thu, May 24, 2007 at 07:02:15AM -0700, bruce wrote:
>
> (If i leave out the md5, and use the "trust" then I can access the db
> without a passwd, but that's not what I need.)

By doing it that way, though, you could access the database and ALTER
USER to set the password correctly.  It must not be what you think it
is.

A

--
Andrew Sullivan  | ajs@crankycanuck.ca
In the future this spectacle of the middle classes shocking the avant-
garde will probably become the textbook definition of Postmodernism.
                --Brad Holland