I'm working with Postgres TIMESTAMP data types and want to change the display format anytime a SELECT query is called.
I currently have it working as shown below:
SELECT to_char(my_time_col, 'YYYY/MM/DD HH24:MI:SS') as time_col
FROM my_table
Is there a way to have it formatted as 2018/05/31 13:00:00 for all queries either via some predefined function, or trigger (or something that I don't know about) without having to manually format the DATETIME fields for each individual query? In other words — I just want to type this:
SELECT my_time_col
FROM my_table
Thanks in advance.