By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
437,541 Members | 1,525 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 437,541 IT Pros & Developers. It's quick & easy.

pg_hba.conf problem

P: n/a
I'm trying to set up the cyrus imap server using PostgreSQL as the
authentication backend.

Currently, the issue I'm having is that I'm unable to connect via psql
on the loopback address (127.0.0.1).

I believe I have the pg_hba.conf file correct, though I've tried a
number of variations other than what I've included below. After each
change to pg_hba.conf, I bounce postgresql (stop start), but still get
a FATAL error re: missing entries for 127.0.0.1.

I'm stumped. I'm probably missing something simple, but I've looked at
a number of samples on usenet and in the PostgreSQL doco, but I haven't
been able to clear this up.

pg_hba.conf
===========

local all all ident sameuser
host all all 127.0.0.1/32 password

command and error
=================

[root@netfinity root]# psql mail -U mail -W -h 127.0.0.1 <
/var/www/html/web-cyradm-0.5.3-1/scripts/create_pgsql.sql
Password: *********
psql: FATAL: No pg_hba.conf entry for host 127.0.0.1, user mail,
database mail

[root@netfinity root]#
Any ideas?

-David

---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to ma*******@postgresql.org)

Nov 12 '05 #1
Share this Question
Share on Google+
6 Replies


P: n/a
David Nedrow writes:
pg_hba.conf
===========

local all all ident sameuser
host all all 127.0.0.1/32 password

command and error
=================

[root@netfinity root]# psql mail -U mail -W -h 127.0.0.1 <
/var/www/html/web-cyradm-0.5.3-1/scripts/create_pgsql.sql
Password: *********
psql: FATAL: No pg_hba.conf entry for host 127.0.0.1, user mail,
database mail


The syntax x.x.x.x/y is only supported in 7.4, but you appear to be using
something older than 7.4.

--
Peter Eisentraut pe*****@gmx.net
---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster

Nov 12 '05 #2

P: n/a
Peter,

Note that I've also tried the following straight for the original
pg_hba.conf file itself. No luck.

# TYPE DATABASE USER IP-ADDRESS IP-MASK
METHOD

host all all 127.0.0.1 255.255.255.255
password

On Nov 30, 2003, at 14:05, Peter Eisentraut wrote:
David Nedrow writes:
pg_hba.conf
===========

local all all ident sameuser
host all all 127.0.0.1/32 password

command and error
=================

[root@netfinity root]# psql mail -U mail -W -h 127.0.0.1 <
/var/www/html/web-cyradm-0.5.3-1/scripts/create_pgsql.sql
Password: *********
psql: FATAL: No pg_hba.conf entry for host 127.0.0.1, user mail,
database mail


The syntax x.x.x.x/y is only supported in 7.4, but you appear to be
using
something older than 7.4.

--
Peter Eisentraut pe*****@gmx.net

---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to ma*******@postgresql.org

Nov 12 '05 #3

P: n/a
On Sun, Nov 30, 2003 at 06:10:08PM -0500, David Nedrow wrote:
Note that I've also tried the following straight for the original
pg_hba.conf file itself. No luck.

host all all 127.0.0.1 255.255.255.255
password


Huh, did you cause the postmaster to reload the pg_hba.conf file after
changing it? You should send it SIGHUP (kill -HUP) or use pg_ctl reload.

--
Alvaro Herrera (<alvherre[a]dcc.uchile.cl>)
"Crear es tan difícil como ser libre" (Elsa Triolet)

---------------------------(end of broadcast)---------------------------
TIP 7: don't forget to increase your free space map settings

Nov 12 '05 #4

P: n/a
Alvaro,

Thanks for the reply. I previously did both of those, as well as
shutting postmaster down altogether and restarting. Still no luck.

I'm sure postmaster is seeing the file, since I can break "local"
support by changing that line. <G>

-David

On Nov 30, 2003, at 18:32, Alvaro Herrera wrote:
On Sun, Nov 30, 2003 at 06:10:08PM -0500, David Nedrow wrote:
Note that I've also tried the following straight for the original
pg_hba.conf file itself. No luck.

host all all 127.0.0.1 255.255.255.255
password


Huh, did you cause the postmaster to reload the pg_hba.conf file after
changing it? You should send it SIGHUP (kill -HUP) or use pg_ctl
reload.

--
Alvaro Herrera (<alvherre[a]dcc.uchile.cl>)
"Crear es tan difícil como ser libre" (Elsa Triolet)

---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?

http://archives.postgresql.org

Nov 12 '05 #5

P: n/a
Alvaro Herrera <al******@dcc.uchile.cl> writes:
On Sun, Nov 30, 2003 at 06:10:08PM -0500, David Nedrow wrote:
Note that I've also tried the following straight for the original
pg_hba.conf file itself. No luck.
Huh, did you cause the postmaster to reload the pg_hba.conf file after
changing it? You should send it SIGHUP (kill -HUP) or use pg_ctl reload.


He said he was using full postmaster restarts, which certainly ought to
do the trick.

The only other idea I can think of is he's editing the wrong pg_hba.conf
file; we've seen a couple of people make that mistake. (David, the
right pg_hba.conf file is the one in the $PGDATA directory. If you
don't see a postmaster.pid file in the same directory that appears and
disappears when you start and stop the postmaster, then you're in the
wrong directory ...)

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?

http://archives.postgresql.org

Nov 12 '05 #6

P: n/a
On Nov 30, 2003, at 21:01, Tom Lane wrote:
The only other idea I can think of is he's editing the wrong
pg_hba.conf
file; we've seen a couple of people make that mistake. (David, the
right pg_hba.conf file is the one in the $PGDATA directory. If you
don't see a postmaster.pid file in the same directory that appears and
disappears when you start and stop the postmaster, then you're in the
wrong directory ...)

Ta-Da!

That was it. For some reason, I had an old pgsql/data tree laying
around that I was futzing with. Looking for postmaster.pid did the
trick.

What I can't figure out is how I was breaking "local" access by editing
the non-local file. Maybe I was just too tired after 18 hours of
debugging Mozilla stuff. <G>

Thanks for the help.

-David
---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster

Nov 12 '05 #7

This discussion thread is closed

Replies have been disabled for this discussion.