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 1iJLW5-0001zw-Rk for pgsql-general@arkaria.postgresql.org; Sat, 12 Oct 2019 17:49:21 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1iJLV6-00052G-Fr for pgsql-general@arkaria.postgresql.org; Sat, 12 Oct 2019 17:48:20 +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 1iJLV6-00051x-4P for pgsql-general@lists.postgresql.org; Sat, 12 Oct 2019 17:48:20 +0000 Received: from lungold.riddles.org.uk ([82.68.208.19]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iJLV3-0003vA-Vm for pgsql-general@postgresql.org; Sat, 12 Oct 2019 17:48:19 +0000 Received: from [192.168.127.1] (port=40078 helo=caithnard.riddles.org.uk) by lungold.riddles.org.uk with esmtp (Exim 4.92.3 (FreeBSD)) (envelope-from ) id 1iJLV2-0009nm-GM; Sat, 12 Oct 2019 17:48:16 +0000 Received: from localhost ([127.0.0.1]:24314 helo=caithnard.riddles.org.uk) by caithnard.riddles.org.uk with esmtp (Exim 4.92.1 (FreeBSD)) (envelope-from ) id 1iJLV2-0009MA-B1; Sat, 12 Oct 2019 17:48:16 +0000 From: Andrew Gierth To: "Abraham\, Danny" Cc: Adrian Klaver , "pgsql-general\@postgresql.org" Subject: Re: day interval In-Reply-To: (Danny Abraham's message of "Sat, 12 Oct 2019 17:36:29 +0000") Message-ID: <874l0dx3qy.fsf@news-spur.riddles.org.uk> References: <8736fyxa2a.fsf@news-spur.riddles.org.uk> <279cfb68-22c7-c5c6-95ec-8234831faf38@aklaver.com> <0e252354f16a45dfa672d5346089a224@phx-exmbprd-01.adprod.bmc.com> <87mue5x60l.fsf@news-spur.riddles.org.uk> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.2 (berkeley-unix) Date: Sat, 12 Oct 2019 18:48:16 +0100 MIME-Version: 1.0 Content-Type: text/plain List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk >>>>> "Abraham" == Abraham, Danny writes: Abraham> Thanks for the clarification. Abraham> The problem is still this: Abraham> select date('20191001') - date('20190101') ; Abraham> in my servers it is always '273'. Abraham> In the customer's DB it is '273 days'; Then you need to establish why that is. For example, try these in psql on the customer's db and show us the outputs: \dT *.date \df *.date select castsource::regtype, casttarget::regtype, castfunc::regprocedure, castcontext, castmethod from pg_cast c join pg_type t on (casttarget=t.oid) where typname='date'; select oprresult::regtype from pg_operator join pg_type t1 on (t1.oid=oprleft) join pg_type t2 on (t2.oid=oprright) where oprname='-' and t1.typname='date' and t2.typname='date'; -- Andrew (irc:RhodiumToad)