Re: Default custom format for specific columns?

From: Aditya Toshniwal <aditya(dot)toshniwal(at)enterprisedb(dot)com>
To: Dave Caughey <caugheyd(at)gmail(dot)com>
Cc: "pgadmin-support lists(dot)postgresql(dot)org" <pgadmin-support(at)lists(dot)postgresql(dot)org>
Subject: Re: Default custom format for specific columns?
Date: 2021-02-01 04:16:17
Message-ID: CAM9w-_kcgad3smyRuOBnX=-MLZKSBGOb-kLSYrkFrzdTC-qe5g@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgadmin-support

Hi Dave,

On Sun, Jan 31, 2021 at 9:16 PM Dave Caughey <caugheyd(at)gmail(dot)com> wrote:

> In my databases, timestamps are stored as longs (epoch millis).
>
> Consequently, when I do a query or view table, I always end up with values
> like 1612106244000, rather than a more readable format of "2021-01-31
> 15:17:24".
>
> Yes, I realize I can do "to_timestamp(cast(mytimestamp/1000 as
> bigint))::timestamp" in a SELECT to convert "mytimestamp" to a
> human-readable form, but it means I have to hand-compose all my queries
> rather than being able to use all the convenient "View/Edit Data..."
> functions.
>
> I'm wondering if there is a way to assign a conversion/formatting function
> (like the above) to specific table columns, e.g., by expanding the table's
> columns and editing the properties, so that whenever you do a view/edit
> data, it actually implements a "to_timestamp(cast(mytimestamp/1000 as
> bigint))::timestamp" for the "mytimestamp" column?
>
> If not, I'm happy to create a RM enhancement request.
>
Currently, there is no such option. You can raise the RM for the team to
discuss on it and decide the priority.

>
> Cheers,
> Dave
>

--
Thanks,
Aditya Toshniwal
pgAdmin hacker | Sr. Software Engineer | *edbpostgres.com*
<http://edbpostgres.com>
"Don't Complain about Heat, Plant a TREE"

In response to

Browse pgadmin-support by date

  From Date Subject
Next Message Khushboo Vashi 2021-02-01 04:50:43 Re: authentication fail
Previous Message Dave Caughey 2021-01-31 15:45:54 Default custom format for specific columns?