pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Sebastien Flaesch <sebastien.flaesch@4js.com>
To: Adrian Klaver <adrian.klaver@aklaver.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: pgsql-general <pgsql-general@lists.postgresql.org>
Subject: Re: SUM() of INTERVAL type produces INTERVAL with no precision
Date: Fri, 3 Dec 2021 16:45:58 +0000
Message-ID: <DBAP191MB1289486D7BA190752083E59DB06A9@DBAP191MB1289.EURP191.PROD.OUTLOOK.COM> (raw)
In-Reply-To: <dc685734-0bf8-fa28-f280-bf3b340e60b6@aklaver.com>
References: <DBAP191MB1289209E98AA6F340651F7A3B06A9@DBAP191MB1289.EURP191.PROD.OUTLOOK.COM>
	<2292656.1638544536@sss.pgh.pa.us>
	<DBAP191MB1289BC291027FD78F77B2737B06A9@DBAP191MB1289.EURP191.PROD.OUTLOOK.COM>
	<DBAP191MB128944EC48D51CB1C34D3EB8B06A9@DBAP191MB1289.EURP191.PROD.OUTLOOK.COM>
	<dc685734-0bf8-fa28-f280-bf3b340e60b6@aklaver.com>


My bad, sorry. RTFM Seb.
Seb
________________________________
From: Adrian Klaver <adrian.klaver@aklaver.com>
Sent: Friday, December 3, 2021 5:30 PM
To: Sebastien Flaesch <sebastien.flaesch@4js.com>; Tom Lane <tgl@sss.pgh.pa.us>
Cc: pgsql-general <pgsql-general@lists.postgresql.org>
Subject: Re: SUM() of INTERVAL type produces INTERVAL with no precision

EXTERNAL: Do not click links or open attachments if you do not recognize the sender.

On 12/3/21 08:12, Sebastien Flaesch wrote:
>
> Hum....
>
> test1=> create table tab2 ( i interval hour to minute );
> CREATE TABLE
> test1=> insert into tab2 values ( interval '9999-10 555 11:22:33' );
> INSERT 0 1
> test1=> select * from tab2;
>                    i
> --------------------------------------
>   9999 years 10 mons 555 days 11:22:00
> (1 row)
>
> Expected?
>
> Qualifiers "hour to minute" seem just to be some decoration...

https://urldefense.com/v3/__https://www.postgresql.org/docs/current/datatype-datetime.html*DATATYPE-...

"... Also, field values “to the right” of the least significant field
allowed by the fields specification are silently discarded. For example,
writing INTERVAL '1 day 2:03:04' HOUR TO MINUTE results in dropping the
seconds field, but not the day field."

>
> Seb
> ------------------------------------------------------------------------



--
Adrian Klaver
adrian.klaver@aklaver.com

view thread (6+ messages)

Message-ID: <DBAP191MB1289486D7BA190752083E59DB06A9@DBAP191MB1289.EURP191.PROD.OUTLOOK.COM>
Permalink:  ../DBAP191MB1289486D7BA190752083E59DB06A9@DBAP191MB1289.EURP191.PROD.OUTLOOK.COM/
Also on:    postgresql.org/message-id/DBAP191MB1289486D7BA190752083E59DB06A9@DBAP191MB1289.EURP191.PROD.OUTLOOK.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: sebastien.flaesch@4js.com, adrian.klaver@aklaver.com, tgl@sss.pgh.pa.us
  Subject: Re: SUM() of INTERVAL type produces INTERVAL with no precision
  In-Reply-To: <DBAP191MB1289486D7BA190752083E59DB06A9@DBAP191MB1289.EURP191.PROD.OUTLOOK.COM>
  References: <DBAP191MB1289209E98AA6F340651F7A3B06A9@DBAP191MB1289.EURP191.PROD.OUTLOOK.COM> <2292656.1638544536@sss.pgh.pa.us> <DBAP191MB1289BC291027FD78F77B2737B06A9@DBAP191MB1289.EURP191.PROD.OUTLOOK.COM> <DBAP191MB128944EC48D51CB1C34D3EB8B06A9@DBAP191MB1289.EURP191.PROD.OUTLOOK.COM> <dc685734-0bf8-fa28-f280-bf3b340e60b6@aklaver.com> <DBAP191MB1289486D7BA190752083E59DB06A9@DBAP191MB1289.EURP191.PROD.OUTLOOK.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