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 1iJYfi-00050R-Nl for pgsql-general@arkaria.postgresql.org; Sun, 13 Oct 2019 07:52:10 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1iJYei-000393-DA for pgsql-general@arkaria.postgresql.org; Sun, 13 Oct 2019 07:51:08 +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 1iJYei-00038V-2U for pgsql-general@lists.postgresql.org; Sun, 13 Oct 2019 07:51:08 +0000 Received: from mx-us-phx-04.bmc.com ([198.147.194.159] helo=mx-us-phx-04-int.bmc.com) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iJYee-0002PQ-AY for pgsql-general@postgresql.org; Sun, 13 Oct 2019 07:51:07 +0000 Received: from pps.filterd (mx-us-phx-04-int.bmc.com [127.0.0.1]) by mx-us-phx-04-int.bmc.com (8.16.0.27/8.16.0.27) with SMTP id x9D7o8ib025722; Sun, 13 Oct 2019 07:50:59 GMT Received: from phx-exmbprd-02.adprod.bmc.com ([172.24.33.167]) by mx-us-phx-04-int.bmc.com with ESMTP id 2vk753b553-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Sun, 13 Oct 2019 07:50:59 +0000 Received: from PHX-EXMBPRD-01.adprod.bmc.com (172.24.35.196) by phx-exmbprd-02.adprod.bmc.com (172.24.33.167) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Sun, 13 Oct 2019 02:50:58 -0500 Received: from PHX-EXMBPRD-01.adprod.bmc.com ([172.24.31.226]) by phx-exmbprd-01.adprod.bmc.com ([172.24.31.226]) with mapi id 15.00.1497.000; Sun, 13 Oct 2019 02:50:58 -0500 From: "Abraham, Danny" To: Andrew Gierth CC: Adrian Klaver , "pgsql-general@postgresql.org" , "Abraham, Danny" , "Primor, Shay" Thread-Topic: [EXTERNAL] Re: day interval Thread-Index: AQHVgSU9nEK3XwX1h0iq+gsESw0hY6dYMlzQ Date: Sun, 13 Oct 2019 07:50:57 +0000 Message-ID: <82901d44029e4e08813fb14f0dc83691@phx-exmbprd-01.adprod.bmc.com> 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> <874l0dx3qy.fsf@news-spur.riddles.org.uk> In-Reply-To: <874l0dx3qy.fsf@news-spur.riddles.org.uk> Accept-Language: en-GB, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-transport-fromentityheader: Hosted x-originating-ip: [192.168.6.253] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: RE: Re: day interval X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2019-10-13_03:,, signatures=0 X-Proofpoint-Spam-Reason: safe List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Thanks everyone. EDB installs oracle compatible parameters. See below C:\Program Files\edb\as9.6\bin>psql -p5488 postgres enterprisedb Password for user enterprisedb: psql (9.6.2.7) ... ### Oracle compatible mode postgres=3D# select date('20191001') - date('20190101'); ?column? ---------- 273 days (1 row) ## Postgres compatible mode postgres=3D# set edb_redwood_date=3Doff; SET postgres=3D# select date('20191001') - date('20190101'); ?column? ---------- 273 (1 row) -----Original Message----- From: Andrew Gierth =20 Sent: Saturday, October 12, 2019 8:48 PM To: Abraham, Danny Cc: Adrian Klaver ; pgsql-general@postgresql.org Subject: [EXTERNAL] Re: day interval >>>>> "Abraham" =3D=3D Abraham, Danny writes: Abraham> Thanks for the clarification. Abraham> The problem is still this: Abraham> select date('20191001') - date('20190101') ; Abraham> in my serv= ers 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=3Dt.oid) where typname=3D'd= ate'; select oprresult::regtype =20 from pg_operator join pg_type t1 on (t1.oid=3Doprleft) join pg_type t2 on (t2.oid=3Doprright) where oprname=3D'-' and t1.t= ypname=3D'date' and t2.typname=3D'date'; -- Andrew (irc:RhodiumToad)