From b3bfb8055eaaa780d138be4d263b702f7e52bdd6 Mon Sep 17 00:00:00 2001 From: Ilya Staroverov Date: Tue, 20 Oct 2026 15:09:48 +0300 Subject: [PATCH v2 2/3] hstore: Mark hstore(record) and populate_record() as STABLE hstore(record) calls the output functions of the record's column types, and populate_record(), which the #= operator also uses, calls their input functions, so their results can depend on settings such as TimeZone, DateStyle or extra_float_digits. Mark them STABLE rather than IMMUTABLE, like the core functions that do the same, such as row_to_json() and jsonb_populate_record(), to reject new expression indexes, generated columns, and partition keys that rely on them being immutable. Note that existing dependent objects are not revalidated by this change, and their definitions may need to be revised before restoring into an installation using hstore 1.9. Bump the hstore extension version to 1.9. Author: Ilya Staroverov Discussion: https://postgr.es/m/19644-d6db3fb5e5ad92f4@postgresql.org --- contrib/hstore/Makefile | 1 + contrib/hstore/hstore--1.8--1.9.sql | 9 +++++++++ contrib/hstore/hstore.control | 2 +- contrib/hstore/meson.build | 1 + 4 files changed, 12 insertions(+), 1 deletion(-) create mode 100644 contrib/hstore/hstore--1.8--1.9.sql diff --git a/contrib/hstore/Makefile b/contrib/hstore/Makefile index 48ee98f0d5c..b02f3fda6a8 100644 --- a/contrib/hstore/Makefile +++ b/contrib/hstore/Makefile @@ -12,6 +12,7 @@ OBJS = \ EXTENSION = hstore DATA = hstore--1.4.sql \ + hstore--1.8--1.9.sql \ hstore--1.7--1.8.sql \ hstore--1.6--1.7.sql \ hstore--1.5--1.6.sql \ diff --git a/contrib/hstore/hstore--1.8--1.9.sql b/contrib/hstore/hstore--1.8--1.9.sql new file mode 100644 index 00000000000..25c00b0d935 --- /dev/null +++ b/contrib/hstore/hstore--1.8--1.9.sql @@ -0,0 +1,9 @@ +/* contrib/hstore/hstore--1.8--1.9.sql */ + +-- complain if script is sourced in psql, rather than via ALTER EXTENSION +\echo Use "ALTER EXTENSION hstore UPDATE TO '1.9'" to load this file. \quit + +-- These call the output or input functions of the record's column types, +-- whose results can depend on settings such as TimeZone. +ALTER FUNCTION hstore(record) STABLE; +ALTER FUNCTION populate_record(anyelement, hstore) STABLE; diff --git a/contrib/hstore/hstore.control b/contrib/hstore/hstore.control index 89e3c746c46..b73c28aa4d3 100644 --- a/contrib/hstore/hstore.control +++ b/contrib/hstore/hstore.control @@ -1,6 +1,6 @@ # hstore extension comment = 'data type for storing sets of (key, value) pairs' -default_version = '1.8' +default_version = '1.9' module_pathname = '$libdir/hstore' relocatable = true trusted = true diff --git a/contrib/hstore/meson.build b/contrib/hstore/meson.build index 6175abc708e..62c540e77e1 100644 --- a/contrib/hstore/meson.build +++ b/contrib/hstore/meson.build @@ -35,6 +35,7 @@ install_data( 'hstore--1.5--1.6.sql', 'hstore--1.6--1.7.sql', 'hstore--1.7--1.8.sql', + 'hstore--1.8--1.9.sql', kwargs: contrib_data_args, ) -- 2.56.0