Re: How to reformat output of "age()" function - Mailing list pgsql-general

From Francisco Olarte
Subject Re: How to reformat output of "age()" function
Date
Msg-id CA+bJJbxWNYGfdaE4qB_WKgHoPeewmQyfLXzhF9Nhhys4j0OqOw@mail.gmail.com
Whole thread Raw
In response to How to reformat output of "age()" function  (David Gauthier <davegauthierpg@gmail.com>)
List pgsql-general
OOps, I got it bad:

On Thu, Sep 12, 2019 at 1:50 PM Francisco Olarte <folarte@peoplecall.com> wrote:

> timestamp / interval arithmetic is really a hairy thing. ( As shown
> below, start point carefully taken to avoid crossing dsts )

It was chosen to FORCE, not AVOID, crossing dst.

> cdrs=# select x, '2019.11.20 20:00:00'::timestamptz + x::interval as
> sum from ( values ('5 mons 10 days 10:00:00'),('163 days
> 11:00:00'),('3923:00:00')) as v(x);
>             x            |          sum
> -------------------------+------------------------
>  5 mons 10 days 10:00:00 | 2020-05-01 06:00:00+02
>  163 days 11:00:00       | 2020-05-02 07:00:00+02
>  3923:00:00              | 2020-05-02 08:00:00+02
> (3 rows)

cdrs=# select x, '2019.11.20 20:00:00'::timestamptz + x::interval as
sum from ( values ('0'),('5 mons 10 days 10:00:00'),('163 days
11:00:00'),('3923:00:00')) as v(x);
            x            |          sum
-------------------------+------------------------
 0                       | 2019-11-20 20:00:00+01
 5 mons 10 days 10:00:00 | 2020-05-01 06:00:00+02
 163 days 11:00:00       | 2020-05-02 07:00:00+02
 3923:00:00              | 2020-05-02 08:00:00+02
(4 rows)

Subject is just complex enough I should avoid making this typos!

Apologies, my fault, bad proof reading, hungry....

Francisco Olarte.



pgsql-general by date:

Previous
From: Francisco Olarte
Date:
Subject: Re: How to reformat output of "age()" function
Next
From: Tom Lane
Date:
Subject: Re: update returning order by syntax error question