Question about new pg12 feature no-rewrite timestamp to timestamptz conversion - Mailing list pgsql-hackers

From Jeremy Finzel
Subject Question about new pg12 feature no-rewrite timestamp to timestamptz conversion
Date
Msg-id CAMa1XUiVntazopn4YUpr=QOeAqZ=Z-EK3xvrbJbOcsNzQMqfOQ@mail.gmail.com
Whole thread Raw
Responses Re: Question about new pg12 feature no-rewrite timestamp totimestamptz conversion  (Bruce Momjian <bruce@momjian.us>)
List pgsql-hackers
I have a question about this (really exciting) feature coming in pg12:

Allow ALTER TABLE .. SET DATA TYPE timestamp/timestamptz to avoid a table rewrite when the session time zone is UTC (Noah Misch)

In the UTC time zone, the data types are binary compatible.

We actually want to migrate all of our databases to timestamptz everywhere.  But some of them have historically saved data in a *local* time zone with data type timestamp.

I assume there is no similarly easy way to do this alter type without a table rewrite for a local time zone?  I would assume DST changes would be an issue here.

But it would be really nice if we have a table with timestamp data saved @ America/Chicago time zone, to set the session to 'America/Chicago' and alter type to timestamptz, and similarly avoid a table rewrite.  Is this possible or feasible?

Thank you!
Jeremy

pgsql-hackers by date:

Previous
From: Juan José Santamaría Flecha
Date:
Subject: Compile using the Visual Studio 2019
Next
From: Tomas Vondra
Date:
Subject: Re: Multivariate MCV stats can leak data to unprivileged users