Re: Converting timestamp to timestamptz without rewriting tables

From: Tom Dunstan <pgsql(at)tomd(dot)cc>
To: Thomas Kellerer <spam_eater(at)gmx(dot)net>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Converting timestamp to timestamptz without rewriting tables
Date: 2017-12-18 08:18:00
Message-ID: CAPPfruztD8m1J_Ln3cvfxaUebKmdsYJpqXH9BeBdEGTC+8Ro-g@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 18 December 2017 at 18:43, Thomas Kellerer <spam_eater(at)gmx(dot)net> wrote:

> > All of the timestamps in our system represent an instant in time, not
> > a clock date/time, so timestamp with time zone is more appropriate.
> > All of the data that is currently on disk in timestamp columns was
> > inserted in a db session in UTC, and represents that timestamp in
> > UTC.
>
>
> Are you aware of the fact that "timestamp with time zone" does NOT
> actually store the time zone?
>

Yes.

> A timestamptz stores everything as UTC and the value is converted to the
> session time zone upon retrieval.
>

Which is exactly what we want.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Corey Taylor 2017-12-18 08:23:47 Re: Converting timestamp to timestamptz without rewriting tables
Previous Message Thomas Kellerer 2017-12-18 08:13:38 Re: Converting timestamp to timestamptz without rewriting tables