diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2022-01-19 17:17:55 -0500 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2022-01-19 17:17:55 -0500 |
commit | a3d6264bbce0ff7002be35a907b73b01e2e37f45 (patch) | |
tree | bd058eea4a8129c08472c13cf33e5beb34feb822 | |
parent | 6c4a8903b93fa5ee088a282b2e8b79ad6571a853 (diff) | |
download | postgresql-a3d6264bbce0ff7002be35a907b73b01e2e37f45.tar.gz postgresql-a3d6264bbce0ff7002be35a907b73b01e2e37f45.zip |
interval_out() must be marked STABLE, not IMMUTABLE.
Its results vary depending on the IntervalStyle GUC, so it cannot
be considered immutable.
This is an extremely ancient bug. AFAICT it was a sloppy mistake
in 6f58115dd, which marked it "cacheable" alongside marking several
other interval functions that way. At the time, interval_out()
depended on DateStyle not IntervalStyle, but it was still wrong.
Back-patching this change doesn't look very practical, so I won't.
Aside from the usual difficulties of getting catalog changes
applied to existing databases, people might have indexes,
generated columns, etc that depend on interval-to-text casts
being considered immutable. (This'd not really give them any
problem as long as they never change IntervalStyle.) They
wouldn't appreciate us breaking such usage in minor releases.
Per bug #17371 from Marcus Gartner.
Discussion: https://postgr.es/m/17371-8f57e6e9ca5e35bf@postgresql.org
-rw-r--r-- | src/include/catalog/catversion.h | 2 | ||||
-rw-r--r-- | src/include/catalog/pg_proc.dat | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/src/include/catalog/catversion.h b/src/include/catalog/catversion.h index 64b9aa36d8b..1c2e38daf42 100644 --- a/src/include/catalog/catversion.h +++ b/src/include/catalog/catversion.h @@ -53,6 +53,6 @@ */ /* yyyymmddN */ -#define CATALOG_VERSION_NO 202201171 +#define CATALOG_VERSION_NO 202201191 #endif diff --git a/src/include/catalog/pg_proc.dat b/src/include/catalog/pg_proc.dat index b6f689e8d1e..0859dc81cac 100644 --- a/src/include/catalog/pg_proc.dat +++ b/src/include/catalog/pg_proc.dat @@ -2290,8 +2290,8 @@ proname => 'interval_in', provolatile => 's', prorettype => 'interval', proargtypes => 'cstring oid int4', prosrc => 'interval_in' }, { oid => '1161', descr => 'I/O', - proname => 'interval_out', prorettype => 'cstring', proargtypes => 'interval', - prosrc => 'interval_out' }, + proname => 'interval_out', provolatile => 's', prorettype => 'cstring', + proargtypes => 'interval', prosrc => 'interval_out' }, { oid => '2903', descr => 'I/O typmod', proname => 'intervaltypmodin', prorettype => 'int4', proargtypes => '_cstring', prosrc => 'intervaltypmodin' }, |