• Eric Chiang's avatar
    storage: fix postgres timezone handling · fd20b213
    Eric Chiang authored
    Dex's Postgres client currently uses the `timestamp` datatype for
    storing times. This lops of timezones with no conversion, causing
    times to lose locality information.
    
    We could convert all times to UTC before storing them, but this is
    a backward incompatible change for upgrades, since the new version
    of dex would still be reading times from the database with no
    locality.
    
    Because of this intrinsic issue that current Postgres users don't
    save any timezone data, we chose to treat any existing installation
    as corrupted and change the datatype used for times to `timestamptz`.
    This is a breaking change, but it seems hard to offer an
    alternative that's both correct and backward compatible.
    
    Additionally, an internal flag has been added to SQL flavors,
    `supportsTimezones`. This allows us to handle SQLite3, which doesn't
    support timezones, while still storing timezones in other flavors.
    Flavors that don't support timezones are explicitly converted to
    UTC.
    fd20b213
Name
Last commit
Last update
Documentation Loading commit data...
api Loading commit data...
cmd Loading commit data...
connector Loading commit data...
examples Loading commit data...
scripts Loading commit data...
server Loading commit data...
storage Loading commit data...
vendor Loading commit data...
version Loading commit data...
web Loading commit data...
.gitignore Loading commit data...
.travis.yml Loading commit data...
DCO Loading commit data...
Dockerfile Loading commit data...
LICENSE Loading commit data...
Makefile Loading commit data...
README.md Loading commit data...
glide.lock Loading commit data...
glide.yaml Loading commit data...
glide_test.go Loading commit data...