Postgres timestamp with timezone breaking change update
I was using
DateTime.UtcNow in .Net to store the current time in a Postgres database. However, after updating to the latest version of the Postgres I noticed that my application doesn't run anymore.
That's because the date type between .Net and Postgres differs. My table columns in the DB were from type
timestamp without timezone , but Entity Framework was sending
timestamp with timezone to my database. There are two ways for fixing that, either you can ask Postgres to ignore this and treat this type as before or you can update your columns to a type that matches your input data type.
I updated my database columns type to
timestamp with timezone using the following migration code:
alter table "Post" alter column "CreatedDate" type timestamp with time zone;