Re: day interval - Mailing list pgsql-general

From Andrew Gierth
Subject Re: day interval
Date
Msg-id 874l0dx3qy.fsf@news-spur.riddles.org.uk
Whole thread Raw
In response to RE: Re: day interval  ("Abraham, Danny" <danny_abraham@bmc.com>)
Responses Re: day interval
RE: Re: day interval
List pgsql-general
>>>>> "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)



pgsql-general by date:

Previous
From: Adrian Klaver
Date:
Subject: Re: day interval
Next
From: Andrew Gierth
Date:
Subject: Re: SELECT d02name::bytea FROM ... && DBI::Pg