Re: How to reformat output of "age()" function

From: Francisco Olarte <folarte(at)peoplecall(dot)com>
To: Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>
Cc: David Gauthier <davegauthierpg(at)gmail(dot)com>, Postgres General <pgsql-general(at)postgresql(dot)org>
Subject: Re: How to reformat output of "age()" function
Date: 2019-09-12 11:58:16
Message-ID: CA+bJJbxWNYGfdaE4qB_WKgHoPeewmQyfLXzhF9Nhhys4j0OqOw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

OOps, I got it bad:

On Thu, Sep 12, 2019 at 1:50 PM Francisco Olarte <folarte(at)peoplecall(dot)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.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2019-09-12 13:44:05 Re: update returning order by syntax error question
Previous Message Francisco Olarte 2019-09-12 11:50:27 Re: How to reformat output of "age()" function