Re: Alter timestamp without timezone to with timezone rewrites rows - Mailing list pgsql-hackers

From Noah Misch
Subject Re: Alter timestamp without timezone to with timezone rewrites rows
Date
Msg-id 20210117002055.GA1695558@rfd.leadboat.com
Whole thread Raw
In response to Re: Alter timestamp without timezone to with timezone rewrites rows  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
On Sat, Jan 16, 2021 at 12:03:19PM -0500, Tom Lane wrote:
> Noah Misch <noah@leadboat.com> writes:
> > On Wed, Jan 13, 2021 at 10:28:26AM -0500, Tom Lane wrote:
> >> So a non-rewriting conversion would only be possible if local time is
> >> identical to UTC; which is true for few enough people that nobody has
> >> bothered with attempting the optimization.
> 
> > PostgreSQL 12 and later do have that optimization.  Example DDL:
> > https://git.postgresql.org/gitweb/?p=postgresql.git;a=commitdiff;h=3c59263#patch4
> 
> Ah, I'd forgotten about that patch (obviously).  It is a kluge, without
> a doubt, since it has to hard-wire knowledge about the behavior of two
> specific conversions into what ought to be general-purpose code.  But
> I guess it is useful often enough to justify its existence.
> 
> I wonder whether it'd be worth moving this logic into a planner support
> function attached to those conversion functions?  I wouldn't bother
> right now, but if somebody else comes along with a similar proposal,
> we should think hard about that.

Yes.



pgsql-hackers by date:

Previous
From: Tom Kincaid
Date:
Subject: Re: Key management with tests
Next
From: Tomas Vondra
Date:
Subject: Re: PoC/WIP: Extended statistics on expressions