Problems with casts?

Sometimes you get message like this ERROR:  cannot cast type … to … Which of course means that PostgreSQL does not know how to cast directly one type into another. In all these cases you can use cast to TEXT – it works always. And from TEXT you can...

PostgreSQL Timestamp vs. UNIX timestamp

select extract(epoch from clock_timestamp()) as present_time_unix, to_timestamp( extract(epoch from clock_timestamp())) as present_time_unix_back_to_postgresql