0

I am trying to package postgres from one machine to another. The source is windows 7 with IP V6 and target is windows XP with IPv4.

Starting postgres on windows XP gives error

2010-11-01 12:01:07 IST LOG:  invalid IP address "::1": Unknown host
2010-11-01 12:01:07 IST CONTEXT:  line 76 of configuration file "C:/postgres/data/pg_hba.conf"
2010-11-01 12:01:07 IST FATAL:  could not load pg_hba.conf

-- postgres - sharing same pg_hba.conf between IpV4 system and IpV6 system

Here is how my pg_hba.conf looks like

# TYPE  DATABASE    USER        CIDR-ADDRESS          METHOD

# IPv4 local connections:
host    all         all         127.0.0.1/32          trust
# IPv6 local connections:
host    all         all         ::1/128               trust

Is there a way to use same pg_hba.conf common to both ipv6 and ipv4?

Jayan
  • 141
  • 1
  • 5
  • 14

3 Answers3

3

This is probably not going to work without some installation routine that patches the pg_hba.conf file for the local situation. You could look for existing lines that initdb created in the initial file and just modify those, if necessary. initdb won't put in an IPv6 line if the system doesn't support IPv6.

In PostgreSQL 9.1 (not yet released), you will be able to put host names into pg_hba.conf. So just writing localhost might work on most of your target systems.

Peter Eisentraut
  • 3,665
  • 1
  • 24
  • 21
1

Just get rid of this line:

host    all         all         ::1/128               trust

If you are on a IPv4-only system the IPv6-loopback address is likely to not be recognized.

Fladi
  • 860
  • 4
  • 8
0

That solution is not working. Try to add -h in postmaster.opts as parameter. This will disable IPv6 and it should start to work again.

growse
  • 8,020
  • 13
  • 74
  • 115