Re: Followup Timestamp to timestamp with TZ conversion - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Followup Timestamp to timestamp with TZ conversion
Date
Msg-id 935020.1627063652@sss.pgh.pa.us
Whole thread Raw
In response to Re: Followup Timestamp to timestamp with TZ conversion  (Peter Volk <peterb.volk@gmx.net>)
Responses Re: Followup Timestamp to timestamp with TZ conversion  (Robert Haas <robertmhaas@gmail.com>)
List pgsql-hackers
Peter Volk <peterb.volk@gmx.net> writes:
> thanks for the reply, I do understand that if a rewrite of the table
> needs to be avoided the binary image needs to be the same. Since PG 12
> there is an optimisation to avoid a rewrite of timestamp columns if
> they are converted to timestamp with tz and the target tz offset is 0

Yes, I'm very well aware of that optimization.  While it's certainly
a hack, it fits within a design that isn't a hack, ie that there are
common, well-defined cases where we can skip the table rewrite.
However, for the reasons I explained before, there are no general-purpose
cases where we can skip an index build on a type-changed column, so
there is no place to insert a similar hack for the timestamp[tz] case.
I'm unwilling to kluge up ALTER TYPE to the extent that would be needed
if the result would only be to handle this one case.

            regards, tom lane



pgsql-hackers by date:

Previous
From: Egor Rogov
Date:
Subject: Re: pg_stats and range statistics
Next
From: Ranier Vilela
Date:
Subject: Re: Fix memory leak when output postgres_fdw's "Relations"