Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1o9lhX-00047T-Ur for pgsql-general@arkaria.postgresql.org; Fri, 08 Jul 2022 10:59:11 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1o9lhW-0005Ro-JV for pgsql-general@arkaria.postgresql.org; Fri, 08 Jul 2022 10:59:10 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1o9lhW-0005Rf-8a for pgsql-general@lists.postgresql.org; Fri, 08 Jul 2022 10:59:10 +0000 Received: from mail.hjp.at ([212.17.106.138] helo=rorschach.hjp.at) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1o9lhS-0002CG-OJ for pgsql-general@lists.postgresql.org; Fri, 08 Jul 2022 10:59:09 +0000 Received: by rorschach.hjp.at (Postfix, from userid 1000) id BC8B17457; Fri, 8 Jul 2022 12:59:05 +0200 (CEST) Date: Fri, 8 Jul 2022 12:59:05 +0200 From: "Peter J. Holzer" To: pgsql-general@lists.postgresql.org Subject: Re: - operator overloading not giving expected result Message-ID: <20220708105905.ja537lv6eec7atuz@hjp.at> Mail-Followup-To: pgsql-general@lists.postgresql.org References: <7f97243d-db62-199a-8412-5637963d117e@fincuro.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="6lkp4m7huc7qefg2" Content-Disposition: inline In-Reply-To: <7f97243d-db62-199a-8412-5637963d117e@fincuro.com> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --6lkp4m7huc7qefg2 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On 2022-07-05 13:52:32 +0530, Rajesh S wrote: > We are migrating our database from Oracle to Postgresql.=A0 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).=A0 But in Post= gres the > same query returns result as "19 days". Which PostgreSQL version is this? I get 19 with PostgreSQL 11.16 and 14.0. hp --=20 _ | Peter J. Holzer | Story must make more sense than reality. |_|_) | | | | | hjp@hjp.at | -- Charles Stross, "Creative writing __/ | http://www.hjp.at/ | challenge!" --6lkp4m7huc7qefg2 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEETtJbRjyPwVTYGJ5k8g5IURL+KF0FAmLIDfQACgkQ8g5IURL+ KF3woA/8C9MbL5lL/a7QZ7gjqs6I7VmR8YlP7Fo5ECKLmR2M0O6u0RwrV6n2XqEy ACXz2IccR/UdYnhLVmfViQ7ufEBcer8FkuEG6VnPPu6/p4wdsWb4toMbXrxAY7ne CoWjquEozuJGmcljQPQeKwnBkDXpgduS0Ft+55BdEl/EOwNhnSyiWKBiG/hEtVC4 BrnbJ+sJiPIR3cxRonJVnYGFd1G6ebIIycw1oEwC7pxso7/ieSnnVpT1N8BhYZlF MfjGo/HhhFX7WWG9D6jYgQLJuppqf3eMIWTEFMucoXW8+9kcKkHw6QUN3zNIdV04 UvjEwDv7pFPjG/4eF273KLv8H/SrT/rl4dGkLWHprQVbJ1XHgI0TH4Xqcz7zs9EP P11TM4jVodRqka2oAgJ9fLSPlGE86HvqNNIG1ZeQC+VsTREda2q9mWcGt138qMP9 m0ObWBjPK38mgh3YXcA4SkFOPOan4LufJC1VoqcNwlnJd7UznL1FK1tK0X7STCkI N4aopGGvM8j0oRMtKLTvVpvv7s+FqRSwnnvMOTqMfQFLu+JpFbx2XiOSrIc/CjNS 6EZ8gfQYYdSv0xyDu/x/M99HF0fdEA+thelwsPrvDzo/mSbdDiftA/4hLqmLOzwW B0cKCkDjrCsdSwdMGGoeOlbohgcIb6eEJ0pRla0KRBpyY+t052Y= =pllZ -----END PGP SIGNATURE----- --6lkp4m7huc7qefg2--