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 1hX8Oq-0004rZ-3F for pgsql-bugs@arkaria.postgresql.org; Sat, 01 Jun 2019 18:06:36 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1hX8Oo-0000Hs-Iq for pgsql-bugs@arkaria.postgresql.org; Sat, 01 Jun 2019 18:06:34 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hX8Oo-00009i-6b for pgsql-bugs@lists.postgresql.org; Sat, 01 Jun 2019 18:06:34 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hX8Ol-0006oc-RJ for pgsql-bugs@lists.postgresql.org; Sat, 01 Jun 2019 18:06:32 +0000 Received: from pro.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id x51I6SQ5021146; Sat, 1 Jun 2019 14:06:28 -0400 From: Tom Lane To: Jorge Gustavo Rocha cc: pgsql-bugs@lists.postgresql.org Subject: Re: BUG #15827: Unable to connect on Windows using pg_services.conf using Python psycopg2 In-reply-to: References: <15827-e6ba53a3a7ed543c@postgresql.org> <82491.1559409563@sss.pgh.pa.us> Comments: In-reply-to Jorge Gustavo Rocha message dated "Sat, 01 Jun 2019 18:58:31 +0100" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <82723.1559412388.1@sss.pgh.pa.us> Date: Sat, 01 Jun 2019 14:06:28 -0400 Message-ID: <82724.1559412388@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Jorge Gustavo Rocha writes: > 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=pg_trabalho, so I think libpq is > reading the file without line end issues. Yeah, that seems like it puts libpq in the clear, but then where are things going wrong? I wonder if psycopg2 is not just "passing the connection parameters down to libpq", but is reading the service file for itself (and failing to take care about newlines). regards, tom lane