pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Abraham, Danny <danny_abraham@bmc.com>
To: Andrew Gierth <andrew@tao11.riddles.org.uk>
Cc: Adrian Klaver <adrian.klaver@aklaver.com>
Cc: pgsql-general@postgresql.org <pgsql-general@postgresql.org>
Cc: Abraham, Danny <danny_abraham@bmc.com>
Cc: Primor, Shay <Shay_Primor@bmc.com>
Subject: RE:  Re: day interval
Date: Sun, 13 Oct 2019 07:50:57 +0000
Message-ID: <82901d44029e4e08813fb14f0dc83691@phx-exmbprd-01.adprod.bmc.com> (raw)
In-Reply-To: <874l0dx3qy.fsf@news-spur.riddles.org.uk>
References: <a95dd36dcc5d4e7380550a727716cfe0@phx-exmbprd-01.adprod.bmc.com>
	<8736fyxa2a.fsf@news-spur.riddles.org.uk>
	<e8d3c7014a2d43f4b1cfe780d61ccde5@phx-exmbprd-01.adprod.bmc.com>
	<279cfb68-22c7-c5c6-95ec-8234831faf38@aklaver.com>
	<0e252354f16a45dfa672d5346089a224@phx-exmbprd-01.adprod.bmc.com>
	<87mue5x60l.fsf@news-spur.riddles.org.uk>
	<b4daa2a10d4d403c97a917faca8bb4c7@phx-exmbprd-01.adprod.bmc.com>
	<874l0dx3qy.fsf@news-spur.riddles.org.uk>


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=# select date('20191001') - date('20190101');
 ?column?
----------
 273 days
(1 row)

## Postgres compatible mode
postgres=# set edb_redwood_date=off;
SET

postgres=# select date('20191001') - date('20190101');
 ?column?
----------
      273
(1 row)

-----Original Message-----
From: Andrew Gierth <andrew@tao11.riddles.org.uk> 
Sent: Saturday, October 12, 2019 8:48 PM
To: Abraham, Danny <danny_abraham@bmc.com>
Cc: Adrian Klaver <adrian.klaver@aklaver.com>; pgsql-general@postgresql.org
Subject: [EXTERNAL] Re: day interval

>>>>> "Abraham" == Abraham, Danny <danny_abraham@bmc.com> 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)





view thread (13+ messages)  latest in thread

Message-ID: <82901d44029e4e08813fb14f0dc83691@phx-exmbprd-01.adprod.bmc.com>
Permalink:  ../82901d44029e4e08813fb14f0dc83691@phx-exmbprd-01.adprod.bmc.com/
Also on:    postgresql.org/message-id/82901d44029e4e08813fb14f0dc83691@phx-exmbprd-01.adprod.bmc.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: danny_abraham@bmc.com, andrew@tao11.riddles.org.uk, adrian.klaver@aklaver.com, Shay_Primor@bmc.com
  Subject: Re: day interval
  In-Reply-To: <82901d44029e4e08813fb14f0dc83691@phx-exmbprd-01.adprod.bmc.com>
  References: <a95dd36dcc5d4e7380550a727716cfe0@phx-exmbprd-01.adprod.bmc.com> <8736fyxa2a.fsf@news-spur.riddles.org.uk> <e8d3c7014a2d43f4b1cfe780d61ccde5@phx-exmbprd-01.adprod.bmc.com> <279cfb68-22c7-c5c6-95ec-8234831faf38@aklaver.com> <0e252354f16a45dfa672d5346089a224@phx-exmbprd-01.adprod.bmc.com> <87mue5x60l.fsf@news-spur.riddles.org.uk> <b4daa2a10d4d403c97a917faca8bb4c7@phx-exmbprd-01.adprod.bmc.com> <874l0dx3qy.fsf@news-spur.riddles.org.uk> <82901d44029e4e08813fb14f0dc83691@phx-exmbprd-01.adprod.bmc.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox