Re: Support TZ format code in to_timestamp() - Mailing list pgsql-hackers

From Daniel Gustafsson
Subject Re: Support TZ format code in to_timestamp()
Date
Msg-id 6191F7A8-128A-4E98-8522-245993E571EC@yesql.se
Whole thread Raw
In response to Re: Support TZ format code in to_timestamp()  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Support TZ format code in to_timestamp()  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: Support TZ format code in to_timestamp()  (Aleksander Alekseev <aleksander@timescale.com>)
List pgsql-hackers
> On 22 Jan 2024, at 03:10, Tom Lane <tgl@sss.pgh.pa.us> wrote:

> I still think it would be a good idea, but I can't deny the lack
> of other interest in it.  Unless someone steps up to review,
> let's close it.

Since I had this on my (ever-growing) TODO I re-prioritized today and took a
look at it since I think it's something we should support.

Nothing really sticks out and I was unable to poke any holes so I don't have
too much more to offer than a LGTM.

+   while (len > 0)
+   {
+       const datetkn *tp = datebsearch(lowtoken, zoneabbrevtbl->abbrevs,
+                                       zoneabbrevtbl->numabbrevs);

My immediate reaction was that we should stop at prefix lengths of two since I
could only think of abbreviations of two or more.  Googling and reading found
that there are indeed one-letter timezones (Alpha, Bravo etc..).  Not sure if
it's worth mentioning that in the comment to help other readers who aren't neck
deep in timezones?

+                 /* FALL THRU */

Tiny nitpick, it looks a bit curious that we spell it FALL THRU here and "fall
through" a few cases up in the same switch.  While we are quite inconsistent
across the tree, consistency within a file is preferrable (regardless of
which).

--
Daniel Gustafsson




pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: the s_lock_stuck on perform_spin_delay
Next
From: Pavel Stehule
Date:
Subject: Re: psql: Allow editing query results with \gedit