Skip to content

Spurious migrations caused by date formatting #59

Open
@cgibbard

Description

@cgibbard

In the case of a default column constraint being set on a timestamp with time zone column, the comparison between the
value as reported to beam-automigrate by postgres and the value that is produced by beam/postgresql-simple never agree.

This really has two issues: postgres seems to report the timestamp using the session timezone, so one way in which it's presently fragile is that we're not being careful to set the timezone to UTC before reading the schema.

Secondly, when postgres reports a timestamp in UTC, it gives the timezone as +00 (zero offset) rather than having a trailing Z (Zulu time indicator). Both of these seem like valid ways to format an ISO timestamp and refer to the same thing, but of course, string comparison fails.

Possibly we could be more type sensitive here and parse the timestamps in this case in order to be able to compare them as UTCTime values.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions