Test: adapt 023.ssl_connection to PostgreSQL 18.
authorTatsuo Ishii <[email protected]>
Tue, 30 Sep 2025 09:04:06 +0000 (18:04 +0900)
committerTatsuo Ishii <[email protected]>
Tue, 30 Sep 2025 09:10:53 +0000 (18:10 +0900)
PostgreSQL 18 heavily changed psql's \conninfo output format, which
made the test fail because the test relies on \conninfo. This commit
makes the test script aware the PostgreSQL version to fix the issue.

Backpatch-through: v4.2

src/test/regression/tests/023.ssl_connection/test.sh

index 9bb40e2ed9f4b3d9e56715dd652a4f6d79e3c55c..95935e8eaf63d142aa5b84f238c83c0709930e72 100755 (executable)
@@ -65,7 +65,13 @@ $PSQL -h localhost test <<EOF > result
 \q
 EOF
 
-grep SSL result
+# PostgreSQL 18 or later prints tablular output for \conninfo.
+# For SSL, "SSL Connection | true (or false)"
+if [ $PGVERSION -ge 18 ];then
+    grep "SSL Connection" result|grep true
+else
+    grep SSL result
+fi
 
 if [ $? != 0 ];then
     echo "Checking SSL connection between frontend and Pgpool-II failed."
@@ -75,7 +81,11 @@ fi
 
 echo "Checking SSL connection between frontend and Pgpool-II was ok."
 
-grep SSL result |grep TLSv1.2
+if [ $PGVERSION -ge 18 ];then
+    grep "SSL Protocol" result|grep TLSv1.2
+else
+    grep SSL result |grep TLSv1.2
+fi
 
 # if SSl protocol version TLSv1.2
 if [ $? = 0 ];then
@@ -111,7 +121,11 @@ $PSQL -h localhost test <<EOF > result
 \q
 EOF
 
-grep SSL result
+if [ $PGVERSION -ge 18 ];then
+    grep "SSL Connection" result|grep true
+else
+    grep SSL result
+fi
 
 if [ $? = 0 ];then
     echo "Checking SSL connection between frontend and Pgpool-II succeeded despite bad ssl_ecdh_curve."