I have a column in a table with datatype set as timestamp without time zone.
I need the time part with microseconds(6 digits), but sometimes if the last digit is zero, the microseconds part ignores it.
I am able to query it with the below query to get 6 digits
select to_char(now(), 'yyyy-mm-dd hh:mi:us');
2020-07-16 12:05:598000
The above output is in text/char format but I need it in timestamp without time zone datatype with all 6 digits for microseconds even if one or some of the last digits are zero. The column datatype is timestamp without time zone
to_char()is perfectly find to display the value in a certain format. If you need atimestampvalue, the display should not matter.