pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Peter J. Holzer <hjp-pgsql@hjp.at>
To: pgsql-general@lists.postgresql.org
Subject: Re: - operator overloading not giving expected result
Date: Fri, 8 Jul 2022 12:59:05 +0200
Message-ID: <20220708105905.ja537lv6eec7atuz@hjp.at> (raw)
In-Reply-To: <7f97243d-db62-199a-8412-5637963d117e@fincuro.com>
References: <7f97243d-db62-199a-8412-5637963d117e@fincuro.com>

On 2022-07-05 13:52:32 +0530, Rajesh S wrote:
> We are migrating our database from Oracle to Postgresql.  In oracle we have
> used this syntax "SELECT ('1999-12-30'::DATE) - ('1999-12-11'::DATE)" to get
> difference between two dates as a integer output (ex: 19).  But in Postgres the
> same query returns result as "19 days".

Which PostgreSQL version is this?

I get 19 with PostgreSQL 11.16 and 14.0.

        hp

-- 
   _  | Peter J. Holzer    | Story must make more sense than reality.
|_|_) |                    |
| |   | hjp@hjp.at         |    -- Charles Stross, "Creative writing
__/   | http://www.hjp.at/ |       challenge!"

Attachments:

  signature.asc (application/pgp-signature, 832B) download

view thread (7+ messages)  latest in thread

Message-ID: <20220708105905.ja537lv6eec7atuz@hjp.at>
Permalink:  ../20220708105905.ja537lv6eec7atuz@hjp.at/
Also on:    postgresql.org/message-id/20220708105905.ja537lv6eec7atuz@hjp.at

 · 

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: hjp-pgsql@hjp.at
  Subject: Re: - operator overloading not giving expected result
  In-Reply-To: <20220708105905.ja537lv6eec7atuz@hjp.at>
  References: <7f97243d-db62-199a-8412-5637963d117e@fincuro.com> <20220708105905.ja537lv6eec7atuz@hjp.at>

* 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