#2237 db: use timestamps with timezone
Merged by tkopecek. Opened by tkopecek.
tkopecek/koji issue2160  into  master

Download 2237.patch

Fixes: https://pagure.io/koji/issue/2160

Not sure, if it solves everything we want. We still return data via API from DB, so users will get local timestamps. @mikem ?

Metadata Update from @tkopecek:
- Pull-request tagged with: testing-ready

Metadata Update from @mfilip:
- Pull-request tagged with: testing-done

This does seem to resolve the issue at hand. I tested with the following method.

  1. configured my local db instance with timezone = 'America/Los_Angeles' (not utc and not my local tz) in postgresql.conf.
  2. restarted postgres
  3. force event creation in my test koji instance (created a new tag)
  4. call getLastEvent and print that tz with time.localtime

Without the schema changes, the reported time is off. With them, it matches my local time.

I'm not seeing any obvious problems, but since this touches so many tables, there's always the possibility of a subtle issue.

At any rate, I think this is the direction we want to go and I don't see any obvious issues, so :thumbsup:

Commit 46752299 fixes this pull-request

Pull-Request has been merged by tkopecek

Metadata