v7-0001-Test-pg_stat_statements-across-crash-restart.patch

text/x-patch

Filename: v7-0001-Test-pg_stat_statements-across-crash-restart.patch
Type: text/x-patch
Part: 0
Message: Re: Better shared data structure management and resizable shared data structures

Patch

Same data as JSON: GET /api/v1/attachments/:id/patch the parsed metadata as JSON — format, series position, per-file stats; never the diff bytes. API reference →
Format: format-patch
Series: patch v7-0001
Subject: Test pg_stat_statements across crash restart
File+
src/test/recovery/t/013_crash_restart.pl 9 0
From 4c695d74a582d0476663040e1c81d6e90b4f8570 Mon Sep 17 00:00:00 2001
From: Heikki Linnakangas <heikki.linnakangas@iki.fi>
Date: Mon, 16 Mar 2026 16:41:17 +0200
Subject: [PATCH v7 01/18] Test pg_stat_statements across crash restart

Add 'pg_stat_statements' to the crash restart test, to test that
shared memory and LWLock initialization works across crash restart in
a library listed in shared_preload_libraries.

Discussion: https://www.postgresql.org/message-id/CAExHW5vM1bneLYfg0wGeAa=52UiJ3z4vKd3AJ72X8Fw6k3KKrg@mail.gmail.com
---
 src/test/recovery/t/013_crash_restart.pl | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/src/test/recovery/t/013_crash_restart.pl b/src/test/recovery/t/013_crash_restart.pl
index 20d648ad6af..960e5462b49 100644
--- a/src/test/recovery/t/013_crash_restart.pl
+++ b/src/test/recovery/t/013_crash_restart.pl
@@ -21,6 +21,15 @@ my $psql_timeout = IPC::Run::timer($PostgreSQL::Test::Utils::timeout_default);
 
 my $node = PostgreSQL::Test::Cluster->new('primary');
 $node->init(allows_streaming => 1);
+
+# Enable pg_stat_statements to test restart of shared_preload_libraries.
+$node->append_conf(
+	'postgresql.conf',
+	qq{shared_preload_libraries = 'pg_stat_statements'
+pg_stat_statements.max = 50000
+compute_query_id = 'regress'
+});
+
 $node->start();
 
 # by default PostgreSQL::Test::Cluster doesn't restart after a crash
-- 
2.47.3