public inbox for [email protected]  
help / color / mirror / Atom feed
From: Michael Paquier <[email protected]>
To: David Steele <[email protected]>
Cc: Fujii Masao <[email protected]>
Cc: Hüseyin Demir <[email protected]>
Cc: Pg Hackers <[email protected]>
Subject: Re: Improve checks for GUC recovery_target_xid
Date: Thu, 5 Mar 2026 13:03:36 +0900
Message-ID: <[email protected]> (raw)
In-Reply-To: <[email protected]>
References: <[email protected]>
	<CAHGQGwEnakTrosMp3Y=Trya4MTC-h8Lqx3FDU1mOALRQ0rz59Q@mail.gmail.com>
	<[email protected]>
	<CAHGQGwG44vZbSoBmg076G+xkR6n=Tj2=q+fVkfP7yEsyF1daFA@mail.gmail.com>
	<[email protected]>

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


Attachments:

  [application/pgp-signature] signature.asc (833B, 2-signature.asc)
  download

view thread (20+ messages)  latest in thread

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected], [email protected], [email protected]
  Subject: Re: Improve checks for GUC recovery_target_xid
  In-Reply-To: <[email protected]>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox