Re: Bug on version 12 ?

From: John W Higgins <wishdev(at)gmail(dot)com>
To: pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: Re: Bug on version 12 ?
Date: 2020-05-15 16:56:04
Message-ID: CAPhAwGwXJCKPdE=0S9dJDhq64v9=R0RSdnDQ3spULQEqJ_0Ubg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Fri, May 15, 2020 at 9:38 AM PegoraroF10 <marcos(at)f10(dot)com(dot)br> wrote:

> Ok Tom but then you cannot go back and forth, like this ...
>
> select to_timestamp(jsonb_build_object('mydate',
> current_timestamp)->>'mydate', 'YYYY-MM-DD HH24:MI:SS');
>

From here [1] - there are 2 green boxes on the page marked "Tip" - the
second one is of interest here.

Apparently the portable format for your need would be

select to_timestamp('2020-04-02T18:26:50.941531-03:00',
'YYYY-MM-DDtHH24:MI:SS');

That works on both PG 11 and PG 12.

John W Higgins

[1] - https://www.postgresql.org/docs/12/functions-formatting.html

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Andreas 'ads' Scherbaum 2020-05-15 17:33:27 Re: Inherited an 18TB DB & need to backup
Previous Message PegoraroF10 2020-05-15 16:38:28 Re: Bug on version 12 ?