Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Spurious migrations caused by date formatting #59

Open
cgibbard opened this issue Apr 23, 2024 · 0 comments
Open

Spurious migrations caused by date formatting #59

cgibbard opened this issue Apr 23, 2024 · 0 comments
Assignees

Comments

@cgibbard
Copy link
Contributor

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.

@cgibbard cgibbard self-assigned this Apr 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant