Re: Patch: shouldn't timezone(text, timestamp[tz]) be STABLE?

Aleksander Alekseev <aleksander@timescale.com>

From: Aleksander Alekseev <aleksander@timescale.com>
To: PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Cc: Tom Lane <tgl@sss.pgh.pa.us>
Date: 2021-09-06T10:10:01Z
Lists: pgsql-hackers
> BTW, it's customary to *not* include catversion bumps in submitted
> patches

Thanks, Tom.

> Anyway, attached is a revised patch that gets rid of the antique
> code, and it produces correct results AFAICT.

I tested your patch against the current master branch 78aa616b on
MacOS Catalina. I have nothing to add to the patch.

> I'm fairly unhappy now that we don't have any
> regression test coverage for this function.

Yep, that's unfortunate. I see several tests for `AT TIME ZONE`
syntax, which is a syntax sugar to timezone() with timestamp[tz]
arguments. But considering how `timetz` type is broken in the first
place [1], I'm not surprised few people feel motivated to do anything
related to it. Do you think there is a possibility that one day we may
be brave enough to get rid of this type?


[1]: https://wiki.postgresql.org/wiki/Don%27t_Do_This#Don.27t_use_timetz

-- 
Best regards,
Aleksander Alekseev



Commits

  1. Fix actively-misleading comments about the contents of struct pg_tm.

  2. Fix bogus timetz_zone() results for DYNTZ abbreviations.

  3. Make timetz_zone() stable, and correct a bug for DYNTZ abbreviations.