Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hX8HS-0004Vz-0G for pgsql-bugs@arkaria.postgresql.org; Sat, 01 Jun 2019 17:58:58 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1hX8HP-0008Hq-DM for pgsql-bugs@arkaria.postgresql.org; Sat, 01 Jun 2019 17:58:55 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hX8HP-0008Hi-5E for pgsql-bugs@lists.postgresql.org; Sat, 01 Jun 2019 17:58:55 +0000 Received: from geo.di.uminho.pt ([193.136.19.136]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hX8HI-0001oi-0f for pgsql-bugs@lists.postgresql.org; Sat, 01 Jun 2019 17:58:54 +0000 Received: from localhost (localhost [127.0.0.1]) by geo.di.uminho.pt (Postfix) with ESMTP id 06DF27002E9 for ; Sat, 1 Jun 2019 18:58:44 +0100 (WEST) X-Virus-Scanned: Debian amavisd-new at geo.di.uminho.pt Received: from geo.di.uminho.pt ([127.0.0.1]) by localhost (geo.di.uminho.pt [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id VvVo6LQkjDNg for ; Sat, 1 Jun 2019 18:58:31 +0100 (WEST) Received: from [192.168.1.96] (170.164.61.94.rev.vodafone.pt [94.61.164.170]) (Authenticated sender: jgr@geomaster.pt) by geo.di.uminho.pt (Postfix) with ESMTPSA id 7F7F3700223 for ; Sat, 1 Jun 2019 18:58:31 +0100 (WEST) Subject: Re: BUG #15827: Unable to connect on Windows using pg_services.conf using Python psycopg2 To: pgsql-bugs@lists.postgresql.org References: <15827-e6ba53a3a7ed543c@postgresql.org> <82491.1559409563@sss.pgh.pa.us> From: Jorge Gustavo Rocha Organization: Geomaster, Lda Message-ID: Date: Sat, 1 Jun 2019 18:58:31 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.7.0 MIME-Version: 1.0 In-Reply-To: <82491.1559409563@sss.pgh.pa.us> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Hi Tom, Thanks for looking at this. I've tried with \n and \r\n separators to make sure it wasn't the problem. I did a od -c to make sure the endings were the expected ones, and I found no difference between just \n or \r\n. The psql is able to deal with service=3Dpg_trabalho, so I think libpq is reading the file without line end issues. I was able to get it run on another Windows (on a virtual machine I've installed). Right now, I suspected that the problem might be even upstream, when libpq tries to use/resolve the address. I have to return to the network where the problem was reported (a large intranet) and test it in the original environment. Regards, Jorge Gustavo =C3=80s 18:19 de 01/06/19, Tom Lane escreveu: > PG Bug reporting form writes: >> I'm using `pg_services.conf` to provide access to a Postgresql databas= e. >> ... >> From other's feedback, I've tried to use the line separators in >> pg_services.conf with \n and \r\n, but the result is the same (because= there >> is strange newline after the host address). >=20 > Hm, can you double check that? It sure looks like something is failing= to > remove the "\r" from that line of pg_service.conf. Which is odd, becau= se > libpq opens the file in text mode so the Windows C library ought to tak= e > care of reducing "\r\n" to "\n". >=20 > It seems like in general, maybe we ought to trim trailing spaces from > pg_service.conf entries automatically. But I'm not entirely sure if > that would fix this problem... >=20 > regards, tom lane >=20 >=20 --=20 Logo*=C2=A0=C2=A0 Geomaster, LDA* =C2=A0 *VENHA DESCOBRIR O CAMINHO DO OPEN SOURCE CONNOSC**O * =C2=A0 Avenida Barros e Soares N.=C2=BA 423, 4715-214 Braga VAT/NIF510 906 109 Phone=C2=A0 +351 253 680 323 Site=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 geomaster.pt GPS=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 41.53322, -8.41929 =09 ------------------------------------------------------------------------ =C2=A0 Jorge Gustavo Rocha CTO Mobile=C2=A0 +351 910 333 888 Email=C2=A0=C2=A0=C2=A0 jgr@geomaster.pt