From 0132a4e8fddad82b0f4876f4ea42b7de142356ba Mon Sep 17 00:00:00 2001
From: Jacob Champion <jacob.champion@enterprisedb.com>
Date: Tue, 7 Oct 2025 15:19:58 -0700
Subject: [PATCH 2/6] libpq: Pin sectionless-keyword behavior in
 pg_service.conf

We've always ignored lines before the first named section of
pg_service.conf. Pin that behavior in the tests so that it doesn't
regress by accident.
---
 src/interfaces/libpq/t/006_service.pl | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/src/interfaces/libpq/t/006_service.pl b/src/interfaces/libpq/t/006_service.pl
index 432a7290c65..9c692739511 100644
--- a/src/interfaces/libpq/t/006_service.pl
+++ b/src/interfaces/libpq/t/006_service.pl
@@ -26,7 +26,15 @@ my $td = PostgreSQL::Test::Utils::tempdir;
 # File that includes a valid service name, and uses a decomposed connection
 # string for its contents, split on spaces.
 my $srvfile_valid = "$td/pg_service_valid.conf";
-append_to_file($srvfile_valid, "[my_srv]\n");
+append_to_file(
+	$srvfile_valid, qq{
+# Settings without a section are, historically, ignored.
+host=256.256.256.256
+port=1
+unknown-setting=1
+
+[my_srv]
+});
 foreach my $param (split(/\s+/, $node->connstr))
 {
 	append_to_file($srvfile_valid, $param . "\n");
-- 
2.34.1

