Re: Improve checks for GUC recovery_target_xid - Mailing list pgsql-hackers

From Michael Paquier
Subject Re: Improve checks for GUC recovery_target_xid
Date
Msg-id aakAmNjKyBWRU1vR@paquier.xyz
Whole thread Raw
In response to Re: Improve checks for GUC recovery_target_xid  (David Steele <david@pgbackrest.org>)
Responses Re: Improve checks for GUC recovery_target_xid
List pgsql-hackers
On Thu, Mar 05, 2026 at 03:40:44AM +0000, David Steele wrote:
> I wrote the tests for recovery_target_timeline but I was not too satisfied
> with them because starting Postgres is fairly expensive.

+# Invalid recovery_target_xid tests
+$node_standby = PostgreSQL::Test::Cluster->new('standby_10');
+$node_standby->init_from_backup($node_primary, 'my_backup',
+    has_restoring => 1);
+$node_standby->start;
+
+my ($result, $stdout, $stderr) = $node_primary->psql('postgres',
+    "ALTER SYSTEM SET recovery_target_xid TO 'bogus'");
+like(
+    $stderr,
+    qr/is not a valid number/,
+    "invalid recovery_target_xid (bogus value)");

Smart move to rely on ALTER SYSTEM to check how the GUC callback is
reacting on incorrect input values.  Why do you need to create and
start a new standby if it is not used, then?
--
Michael

Attachment

pgsql-hackers by date:

Previous
From: Michael Paquier
Date:
Subject: Re: Add pg_stat_recovery system view
Next
From: shveta malik
Date:
Subject: Re: [PATCH] Support automatic sequence replication