Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1aQiNy-0008UB-P5 for pgsql-jdbc@arkaria.postgresql.org; Tue, 02 Feb 2016 21:21:18 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84) (envelope-from ) id 1aQiNx-0001Ob-OX for pgsql-jdbc@arkaria.postgresql.org; Tue, 02 Feb 2016 21:21:17 +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_SHA384:256) (Exim 4.84) (envelope-from ) id 1aQiNx-0001OV-De for pgsql-jdbc@postgresql.org; Tue, 02 Feb 2016 21:21:17 +0000 Received: from mail-vk0-x233.google.com ([2607:f8b0:400c:c05::233]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84) (envelope-from ) id 1aQiNu-0001bp-GB for pgsql-jdbc@postgresql.org; Tue, 02 Feb 2016 21:21:16 +0000 Received: by mail-vk0-x233.google.com with SMTP id n1so823480vkb.3 for ; Tue, 02 Feb 2016 13:21:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:subject:from:to:date:in-reply-to:references:content-type :mime-version:content-transfer-encoding; bh=KNgh05KneX5MU1MTVmj6bdEWZAw7gS39PuLC0O/MMCA=; b=TiRYDOhk6Y5KbYjWi+ZFPX1YiLDeo9GUHxPwUGNN2IvjnIOGQHLJdpTOKYSUx1+3a7 bD9THgVFMPUTK46AiPIyoWQizfmivnPmeY3lbVD9hZoAK4/PK9XCMRcSX303iItT6jId CuOHftSnak0nUDEnNsh4mWQz2fhEYkQUlebyo88EQr6EYALQUEGJ9hMmAKL9ABtbLFoY YvYYxz1fRH443YZseQ9kyq04f6qJcDX+x8/Nw6klpS7KLek9lcgAzsXzlZxe30j6CAbt sp12DFVn0mi3sqNe/cf5FgKeqrEXtoxKSIn7WIAzdXnXYj8cTVhc5vTINKsednqxB5uQ Gy6g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:message-id:subject:from:to:date:in-reply-to :references:content-type:mime-version:content-transfer-encoding; bh=KNgh05KneX5MU1MTVmj6bdEWZAw7gS39PuLC0O/MMCA=; b=PZ6kc0Ut+eRppGOFTney2b1IqnM7Foj9tT5snlT3+thjQ3RoTkCdck7EUYLsyaSfAI 1IeEn6//alJqtrzIAiXLOZ/9HmP+3uWQCs88xiFMLCmZNTfyoMNHmpnU7rTnTLJXuXXq Tqk2eR7eyRWN2aZGxxgI3cn9c7d6/iO2eaVpjs/9qcJ6qUvVkzRVGSLeyxid+U9Eh1/Z wHX6V/o4Rnn9nGZTBUoOpUvsfto8AseYsVvo7o3JnRFveX7O8jEqqr9WNFEpUW/TUSOE ELvwEGaYogij0A5+FgcYvsddO7/Qc4T2a6c8xx8RfXt1IAU1Dv0pc0BJABlh5m3t/wQh PRMw== X-Gm-Message-State: AG10YOS/PtHmaPzsgyj6sv6XdSb1QIIyOuFjepaTFSMW8JYFA9flQ2pMjQ6+45ztcRl8Pw== X-Received: by 10.31.166.200 with SMTP id p191mr21668205vke.53.1454448071488; Tue, 02 Feb 2016 13:21:11 -0800 (PST) Received: from roblaptop ([187.65.195.19]) by smtp.gmail.com with ESMTPSA id w8sm1472105vkw.10.2016.02.02.13.21.10 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 02 Feb 2016 13:21:11 -0800 (PST) Message-ID: <1454448068.2165.20.camel@gmail.com> Subject: Re: Unable to connect to 9.5 via JDBC driver 1207 From: rob stone To: Thomas Kellerer , pgsql-jdbc@postgresql.org Date: Wed, 03 Feb 2016 08:21:08 +1100 In-Reply-To: References: <1454432904.2165.6.camel@gmail.com> <10633.1454441931@sss.pgh.pa.us> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.18.3-1 Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-Pg-Spam-Score: -2.7 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-jdbc Precedence: bulk Sender: pgsql-jdbc-owner@postgresql.org On Tue, 2016-02-02 at 21:10 +0100, Thomas Kellerer wrote: > Tom Lane schrieb am 02.02.2016 um 20:38: > > > > > > Since the quoted error message mentions a connection from > > "127.0.0.1", > > it's impossible that it is a reply from a remote server (unless > > your > > networking configuration is completely broken).  Presumably what is > > happening is that what you think is a connection to a remote PG > > server > > is actually being made to localhost, and the local PG server's > > pg_hba.conf > > doesn't allow the username and/or dbname.  You could check that by > > turning > > on log_connections on both servers. > > > > As to why that would happen as a consequence of a driver version > > change, > > I'm pretty clueless, but I would wonder about differences in driver > > config > > files or the driver's interpretation of a connection URL.  In any > > case, > > certainly not enough information has been given to diagnose it. > > > The initial error message in this thread was not from me. > > I am currently not in the office, but I will see if I can reproduce > that tomorrow. > > I have also contacted the SQL Workbench/J user who reported this to > me last week > and asked him to describe his setup as well. > > In his case, the error message was: > > > FATAL: no pg_hba.conf entry for host "213.xxx.xx.xxx", user > > "foobar", database "postgres", SSL on > > If I understood him correctly, he has no access to the server, so the > only thing he did, > was to change the driver and he could connect again. > > Thomas > > > I'm using a domain socket connection on my laptop. There is NO network. I've been using JDBC drivers since Postgres 8.x. The pg_hba.conf file has always been identical. postgresql-9.4-1200.jdbc41.jar works fine on 9.4. The issue is with 9.5. So "local all all trust" according to the pg_hba.conf doco "translates" to "localhost domain socket connection, any user, any database and trust the person connecting" -- i.e. don't validate password. The package org.postgresql.core.v3.ConnectionFactoryImpl doesn't display enough information in its error message. It should display the URL used, which has to be built using pg_hba.conf plus user input. This:- con = DriverManager.getConnection(url, user, password); is the usual way to connect. I don't know if using port 5434 for 9.5 is an issue. I'm still using 9.4 and its port number is 5433. (Clutching at straws. Probable red herring.) Please let me know if there are any other tests that I can run. Cheers, Rob -- Sent via pgsql-jdbc mailing list (pgsql-jdbc@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-jdbc