Re: BUG #16550: Problem with pg_service.conf

From: Michał Lis <fcs1(at)poczta(dot)onet(dot)pl>
To: pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: BUG #16550: Problem with pg_service.conf
Date: 2020-07-21 20:44:17
Message-ID: a131254e-414e-8728-ce04-4a0829291f83@poczta.onet.pl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Hello,

Thank you for so quick response.

To reproduce problem:

1. Create pg_service.conf file like this:

[test4]
host=192.168.1.2
port=5433
dbname=test
user=postgres
password=abcd

2. Save this file in a directory, in my case it was
D:\PostgreSQLx86\9.6\etc\pg_service.conf
   (line ends in Linux style by NotePad++)

3. Set the global system variable:
PGSERVICEFILE =D:\PostgreSQLx86\9.6\etc\pg_service.conf

4. Restart computer to take effects for setting PGSERVICEFILE

5. Open PGAdmin 3 or 4 no matter which.

6. Add and Set database connection

On the local machine the connection will be established but on remote
machine the error:

definition of service "test4" not found

will be raised

Connection from remote machine to server by host, port, user and
password works fine.

Regards
Michal

W dniu 2020-07-21 o 18:20, PG Bug reporting form pisze:
> The following bug has been logged on the website:
>
> Bug reference: 16550
> Logged by: Michal L
> Email address: fcs1(at)poczta(dot)onet(dot)pl
> PostgreSQL version: 9.6.11
> Operating system: Windows 7 x64 Pro/Ultimate
> Description:
>
> Hello,
>
> I can't connect to a database via service defined in pg_service.conf file
> from remote machine.
>
> Connection from local machine using this service definition works fine.
>
> I tested it on PostgreSQL 9.4 and 9.6.
>
> The other problem is with the localization of the pg_service.conf file.
> Reading internet solutions, I found, that this file may be placed in global
> configuration folder. In my case it is D:\PostgrSQLx86\9.6\etc (the
> SYSCONFDIR variable displayed by pg_config.exe).
> Placing the file into this folder does not work.
>
> I had to define the global system variable PGSERVICEFILE =
> D:\PostgrSQLx86\9.6\etc\pg_service.conf.
> After that the connection to database via service began work, but only on
> local machine.
>
> Regards
> Michal
>

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Michael Paquier 2020-07-22 01:50:27 Re: cannot find postgresqllogreaderadapter
Previous Message David G. Johnston 2020-07-21 18:07:23 Re: BUG #16550: Problem with pg_service.conf