pg_hba.conf problem in PostgreSQL 8.4 (no-installer)

Поиск
Список
Период
Сортировка
Искать

pg_hba.conf problem in PostgreSQL 8.4 (no-installer)

От:
Paweł Nieścioruk <pawelni@uhc.com.pl>
Дата:
Hello,

I'm developing JSF web application in Java with Tomcat and PostgreSQL on 
the server. I use  PostgreSQL 8.x NO INSTALLER version (zip file).
Everything work fine until I moved from PostgreSQL 8.2 to PostgreSQL 8.4 
- now I have problems with starting registered PostgreSQL service on 
Windows XP Prof or Windows Vist (Home Premium). The problem is connected 
with pg_hba.conf entries.

Detailed description of the whole process:

My Java code registers PostgeSQL service under Windows by executing 
command:
"C:\Program Files\MyApplication\database/bin/pg_ctl" -D "C:\Program 
Files\MyApplication\database\data" register -N PostgreSQL_Service
It works OK (I am doing this on local account with administrator 
privilleges, I have database cluster generated before) - the service is 
registered for Local Service Account. Now my Java code tries to start 
the service using command "sc.exe start PostgreSQL_Service". And this fails.

I would like to use ONE COMMON pg_hba.conf file for XP and Vista. When I 
had PostgreSQL 8.2 version, the file has those entries:

# IPv4 local connections:
host    all         root         127.0.0.1/32          md5
# IPv6 local connections:
host    all        root    ::1/32        md5

And it WORKED OK for BOTH Windows XP and Vista. Now we changed 
PostgreSQL to version 8.4 (still no-installer version) and our 
pg_hba.conf file looks like this now:

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

When last line (IPv6) is present it, registered service does NOT start 
under Windows XP BUT WORKS under Vista  (this XP windows have only IPv4 
protocol and it is enabled, Vista have both IPv4 and IPv6 installed and 
enabled) - in the Windows Events Log I see error saying: FATAL:  could 
not load pg_hba.conf.

When last line is removed (or commented), registered service starts and 
WORKS under XP, BUT under VISTA I see error during startup saying about 
missing entry for host ::1.

I don't use any antivirus/firewall during the test (it was tested under 
clean Windows installation, standard firewall was deactivated also).

The questions are:
1. Is it possible to have such common pg_hba.conf file for XP and Vista
2. Why it worked OK under PostgreSQL 8.2 and under 8.4 it stopped 
working (is it somehow connected with fully parsing pg_hba.conf describe 
here:  
http://www.postgresql.org/docs/8.4/static/release-8-4.html#RELEASE-8-4-PG-HBA-CONF)

Regards,
Pawel


FAQ