Re: Patch: shouldn't timezone(text, timestamp[tz]) be STABLE?
John Naylor <john.naylor@enterprisedb.com>
From: John Naylor <john.naylor@enterprisedb.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Aleksander Alekseev <aleksander@timescale.com>, PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2021-08-31T17:34:06Z
Lists: pgsql-hackers
On Mon, Aug 30, 2021 at 12:58 PM Tom Lane <tgl@sss.pgh.pa.us> wrote: > > Aleksander Alekseev <aleksander@timescale.com> writes: > > Got it. But in this case, what's your opinion on the differences between > > date_trunc() and timezone()? Shouldn't date_trunc() be always IMMUTABLE as > > well? > > No, because date_trunc depends on the current timezone setting, > or at least its stable variants do. A light bulb went off in my head just now, because I modeled date_bin() in part on date_trunc(), but apparently it didn't get the memo that the variant with timezone should have been marked stable. I believe it's been discussed before that it'd be safer if pg_proc.dat had the same defaults as CREATE FUNCTION, and this is further evidence for that. -- John Naylor EDB: http://www.enterprisedb.com
Commits
-
Fix actively-misleading comments about the contents of struct pg_tm.
- 89dba59590fd 15.0 landed
-
Fix bogus timetz_zone() results for DYNTZ abbreviations.
- eb3c8d24808a 12.9 landed
- d8a266c5e1bd 13.5 landed
- b28c862a6c11 10.19 landed
- 90b4647f63da 11.14 landed
- 599c73a91a04 14.0 landed
- 5907c3818c43 9.6.24 landed
-
Make timetz_zone() stable, and correct a bug for DYNTZ abbreviations.
- 388e71af880d 15.0 landed