Add support for AT LOCAL

Vik Fearing <vik@postgresfriends.org>

From: Vik Fearing <vik@postgresfriends.org>
To: PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2023-06-06T03:13:52Z
Lists: pgsql-hackers

Attachments

The Standard defines time zone conversion as follows:

<datetime factor> ::=
   <datetime primary> [ <time zone> ]

<time zone> ::=
   AT <time zone specifier>

<time zone specifier> ::=
     LOCAL
   | TIME ZONE <interval primary>


While looking at something else, I noticed we do not support AT LOCAL. 
The local time zone is defined as that of *the session*, not the server, 
which can make this quite interesting in views where the view will 
automatically adjust to the session's time zone.

Patch against 3f1aaaa180 attached.
-- 
Vik Fearing

Commits

  1. Dodge a compiler bug affecting timetz_zone/timetz_izone.

  2. Back-patch test cases for timetz_zone/timetz_izone.

  3. Add regression test coverage for timetz_izone().

  4. Add support for AT LOCAL

  5. doc: Mention timezone(zone, time) in section for AT TIME ZONE

  6. Use HASH_BLOBS for xidhash.