RE: Re: day interval

From: "Abraham, Danny" <danny_abraham(at)bmc(dot)com>
To: Andrew Gierth <andrew(at)tao11(dot)riddles(dot)org(dot)uk>
Cc: Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>, "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>, "Abraham, Danny" <danny_abraham(at)bmc(dot)com>, "Primor, Shay" <Shay_Primor(at)bmc(dot)com>
Subject: RE: Re: day interval
Date: 2019-10-13 07:50:57
Message-ID: 82901d44029e4e08813fb14f0dc83691@phx-exmbprd-01.adprod.bmc.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


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(at)tao11(dot)riddles(dot)org(dot)uk>
Sent: Saturday, October 12, 2019 8:48 PM
To: Abraham, Danny <danny_abraham(at)bmc(dot)com>
Cc: Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>; pgsql-general(at)postgresql(dot)org
Subject: [EXTERNAL] Re: day interval

>>>>> "Abraham" == Abraham, Danny <danny_abraham(at)bmc(dot)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)

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Adrian Klaver 2019-10-13 15:57:57 Re: day interval
Previous Message Tom Lane 2019-10-12 20:27:11 Re: day interval