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 1htRnV-0002TO-6v for pgsql-jdbc@arkaria.postgresql.org; Fri, 02 Aug 2019 07:16:17 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1htRnU-000339-29 for pgsql-jdbc@arkaria.postgresql.org; Fri, 02 Aug 2019 07:16:16 +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 1htRnT-0002yn-N0 for pgsql-jdbc@lists.postgresql.org; Fri, 02 Aug 2019 07:16:15 +0000 Received: from mail.netcetera.ch ([194.126.145.7] helo=mail.netcetera.com) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.92) (envelope-from ) id 1htRnQ-0000tU-Kl for pgsql-jdbc@lists.postgresql.org; Fri, 02 Aug 2019 07:16:14 +0000 Received: from activeguard-mta1.netcetera.com (activeguard-mta1.netcetera.com [192.168.8.153]) by mail.netcetera.com (8.14.7/8.14.1) with ESMTP id x727G90O057349 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Fri, 2 Aug 2019 09:16:09 +0200 Received: from xguard (ag_core.activeguard.xor [10.200.0.3]) by activeguard-mta1.netcetera.com (Postfix) with ESMTP id A29AE1E42955 for ; Fri, 2 Aug 2019 09:16:16 +0200 (CEST) Authentication-Results: auth.opendkim.xorlab.com; dkim=none Received: from netcetera.com (smtp-int.netcetera.com [172.16.0.139]) by activeguard-mta1.netcetera.com (Postfix) with ESMTPS id 7CECB1E42960 for ; Fri, 2 Aug 2019 09:16:13 +0200 (CEST) Received: from Philippes-MacBook.local ([172.19.119.6]) by netcetera.com (8.14.7/8.14.1) with ESMTP id x727G5P2048964 for ; Fri, 2 Aug 2019 09:16:06 +0200 Subject: Re: TimestampUtils.toJavaSecs / toPgSecs seem dubious To: pgsql-jdbc@lists.postgresql.org References: <5D3AF944.6020900@anastigmatix.net> From: Philippe Marschall Message-ID: <58b6cc1f-26ba-9689-86bd-e63134c95418@netcetera.com> Date: Fri, 2 Aug 2019 09:16:03 +0200 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: <5D3AF944.6020900@anastigmatix.net> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=2.2 required=5.0 tests=BAYES_50,SPF_HELO_SOFTFAIL, SPF_SOFTFAIL autolearn=disabled version=3.4.2 X-Spam-Level: ** X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on activeguard-mta1 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 26.07.19 14:59, Chapman Flack wrote: > pgJDBC's toJavaSecs() and toPgSecs() methods contain some dubious > adjustments, apparently there in an attempt to make the java.sql > mapping less weird. But it really succeeds only in smearing the weird > around so it's not where it belongs, and some even gets on the java.time > mapping, which ought to be free of weird. So, I had a look at this. I can only reproduce it with the binary protocol, not with the text protocol. So as a short term work around switching to the text protocol should work. java.time inherits the weird because it also goes through toJavaSecs. I am working on a patch but it needs more tests and polish. I hope I'll be able to submit a bug and PR shortly. Cheers Philippe