Re: Problems logging in - Mailing list pgsql-general

From Richard Broersma Jr
Subject Re: Problems logging in
Date
Msg-id 20060423011818.66490.qmail@web31801.mail.mud.yahoo.com
Whole thread Raw
In response to Problems logging in  (John Oliver <joliver@john-oliver.net>)
Responses Re: Problems logging in  (John Oliver <joliver@john-oliver.net>)
List pgsql-general
> I installed the RPMs and the service starts and runs.  I added a user
> and gave it a password, and gave the psql user "postgres" a different
> password.  But I can log on with neither.  No, I didn't forget the
> passwords :-)

when you first start postgres you need to specify the database you are connecting to.

when you connect you could use template1 as it is reinstalled with postgresql:

    psql -U postgres -d template1

However, it would be safer (especially for new db users) to first create a testing database with
the shell command createdb.

    createdb mydb

Of course, for all of this to work your pg_hba.conf file must be working order.

> Searching for this sort of problem leads to a lot of the same thing, and
> a lot of different responses about how the pg_hba.conf should read.
> I've tried a huge number of variations, restarting the service between
> each iteration.

you can reference the following page for ideas:
http://www.postgresql.org/docs/7.4/interactive/client-authentication.html#EXAMPLE-PG-HBA.CONF

but to get started I would recommend:
"
 TYPE  DATABASE    USER        IP-ADDRESS        IP-MASK           METHOD
local   all         all                                             trust

"

> Normally, stuff like this is less painful with logs.  But I can find no
> working log file for psql.  In /etc/init.d/postgresql, I found a line
> PGLOG=/dev/null amd replaced it with PGLOG=/var/log/psqllog
> /var/log/psqllog was created but is 0 length after restarting the
> service and a few failed login attempts.  Assuming there's no "This is
> the exact reason why your logins don't work" answer, how do I get
> logging working so as to at least have another clue?

Let preface the next portion of my reply with the fact that I am not positive what I am says is
true for Version 7 of postgresql.

unless you specify otherwise, your log file will be located in your data directory.
the first one is postgresql.log.
The other log files are located in ../data/pg_log/

One point to be aware of,  the type of messages that appear in the depends upon the setting of you
postgresql.conf file.

I hope some of this helps.

Regards,

Richard Broersma Jr.


pgsql-general by date:

Previous
From: Richard Broersma Jr
Date:
Subject: Re: Performance
Next
From: John Oliver
Date:
Subject: Re: Problems logging in