I found that provolatile attribute of to_timestamp in pg_proc is wrong: test=# select provolatile, proargtypes from pg_proc where proname = 'to_timestamp' and proargtypes[0] = 701; provolatile | proargtypes -------------+------------- i | 701 (1 row)
'i' (immutable) is clearly wrong since the function's return value can be changed depending on the time zone settings. Actually the manual says functions depending on time zone settings should be labeled STABLE. https://www.postgresql.org/docs/14/xfunc-volatility.html "A common error is to label a function IMMUTABLE when its results depend on a configuration parameter. For example, a function that manipulates timestamps might well have results that depend on the TimeZone setting. For safety, such functions should be labeled STABLE instead." It's intersting that two arguments form of to_timestamp has correct attribute value ('s': stable) for provolatile in pg_proc. Do we want to fix this for PG16? I think it's too late for 15. Best reagards, -- Tatsuo Ishii SRA OSS, Inc. Japan English: http://www.sraoss.co.jp/index_en.php Japanese:http://www.sraoss.co.jp