Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit a3d6264

Browse files
committed
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 6f58115, 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
1 parent 6c4a890 commit a3d6264

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/include/catalog/catversion.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,6 @@
5353
*/
5454

5555
/* yyyymmddN */
56-
#define CATALOG_VERSION_NO 202201171
56+
#define CATALOG_VERSION_NO 202201191
5757

5858
#endif

src/include/catalog/pg_proc.dat

+2-2
Original file line numberDiff line numberDiff line change
@@ -2290,8 +2290,8 @@
22902290
proname => 'interval_in', provolatile => 's', prorettype => 'interval',
22912291
proargtypes => 'cstring oid int4', prosrc => 'interval_in' },
22922292
{ oid => '1161', descr => 'I/O',
2293-
proname => 'interval_out', prorettype => 'cstring', proargtypes => 'interval',
2294-
prosrc => 'interval_out' },
2293+
proname => 'interval_out', provolatile => 's', prorettype => 'cstring',
2294+
proargtypes => 'interval', prosrc => 'interval_out' },
22952295
{ oid => '2903', descr => 'I/O typmod',
22962296
proname => 'intervaltypmodin', prorettype => 'int4',
22972297
proargtypes => '_cstring', prosrc => 'intervaltypmodin' },

0 commit comments

Comments
 (0)