469,950 Members | 1,664 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,950 developers. It's quick & easy.

pg_hba behavior

We ran into a problem with pg_hba processing recently when we upgraded
from 7.3.2 to 7.4.5. We use postgres as part of a network appliance that
runs on Solaris 9/intel boxes. 7.4.5 runs fine in our development
environment, but when we deploy it to a production box, we get a
"missing or erroneous pg_hba.conf file" error.

The error in the log is
"invalid entry in pg_hba.conf file at line 60, token 255.255.255.255"
which corresponds to the default line included with the pg_hba.conf that
gets built:
host all all 127.0.0.1 255.255.255.255
trust

I traced this to hba.c, and it looks like the main diff in this area
between 7.3.2 and 7.4.5 is that the call to getaddrinfo() has been
added. We wrote a quick test program to just call getaddrinfo() passing
it 255.255.255.255, and ran it on our dev and production platforms. On
the dev platform it returns 0, but on our production platform it returns
EAI_NONAME.

The big difference in the platforms is that DNS is not enabled on the
production box - everything is resolved through etc/hosts. I assume this
is the root of the problem.

I realize that, having traced it to getaddrinfo(), this is not *really*
a postgres issue, but I wonder if anybody has run into this before, and
if so what the solution is. It seems that a value of 0.0.0.0 works, but
I want to understand what's going on before I start whacking away at the
pg_hba.conf (or the etc/hosts, for that matter).
- DAP
================================================== ====
David Parker Tazz Networks (401) 709-5130


---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to ma*******@postgresql.org so that your
message can get through to the mailing list cleanly

Nov 23 '05 #1
1 1277

Yes, try 127.0.0.1/32 and remove the netmask. We supported that in 7.4
and there is some Solaris bug that is triggered if you don't do that.

This is the default in 8.0.

---------------------------------------------------------------------------

David Parker wrote:
We ran into a problem with pg_hba processing recently when we upgraded
from 7.3.2 to 7.4.5. We use postgres as part of a network appliance that
runs on Solaris 9/intel boxes. 7.4.5 runs fine in our development
environment, but when we deploy it to a production box, we get a
"missing or erroneous pg_hba.conf file" error.

The error in the log is
"invalid entry in pg_hba.conf file at line 60, token 255.255.255.255"
which corresponds to the default line included with the pg_hba.conf that
gets built:
host all all 127.0.0.1 255.255.255.255
trust

I traced this to hba.c, and it looks like the main diff in this area
between 7.3.2 and 7.4.5 is that the call to getaddrinfo() has been
added. We wrote a quick test program to just call getaddrinfo() passing
it 255.255.255.255, and ran it on our dev and production platforms. On
the dev platform it returns 0, but on our production platform it returns
EAI_NONAME.

The big difference in the platforms is that DNS is not enabled on the
production box - everything is resolved through etc/hosts. I assume this
is the root of the problem.

I realize that, having traced it to getaddrinfo(), this is not *really*
a postgres issue, but I wonder if anybody has run into this before, and
if so what the solution is. It seems that a value of 0.0.0.0 works, but
I want to understand what's going on before I start whacking away at the
pg_hba.conf (or the etc/hosts, for that matter).
- DAP
================================================== ====
David Parker Tazz Networks (401) 709-5130
---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to ma*******@postgresql.org so that your
message can get through to the mailing list cleanly


--
Bruce Momjian | http://candle.pha.pa.us
pg***@candle.pha.pa.us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073

---------------------------(end of broadcast)---------------------------
TIP 8: explain analyze is your friend

Nov 23 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

11 posts views Thread by Angel Todorov | last post: by
6 posts views Thread by David Nedrow | last post: by
19 posts views Thread by E. Robert Tisdale | last post: by
reply views Thread by Tom Allison | last post: by
5 posts views Thread by Raymond O'Donnell | last post: by
12 posts views Thread by Rajesh S R | last post: by
28 posts views Thread by v4vijayakumar | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.