From b976eaf4cbbef79b43fb541b33982d9d742c7f75 Mon Sep 17 00:00:00 2001
From: Laurenz Albe <laurenz.albe@cybertec.at>
Date: Thu, 9 Jan 2025 10:41:34 +0100
Subject: [PATCH v1] Add ldapscheme to pg_hba_file_rules

That option was forgotten in the pg_hba_file_rules() function.
This fixes bug #18769.  Backpatch all the way.

Author: Laurenz Albe
Discussion: https://postgr.es/m/18769-dd8610cbc0405172@postgresql.org
---
 src/backend/utils/adt/hbafuncs.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/backend/utils/adt/hbafuncs.c b/src/backend/utils/adt/hbafuncs.c
index beaae88e541..43cef2572f8 100644
--- a/src/backend/utils/adt/hbafuncs.c
+++ b/src/backend/utils/adt/hbafuncs.c
@@ -89,6 +89,10 @@ get_hba_options(HbaLine *hba)
 			options[noptions++] =
 				CStringGetTextDatum(psprintf("ldapport=%d", hba->ldapport));
 
+		if (hba->ldapscheme)
+			options[noptions++] =
+				CStringGetTextDatum(psprintf("ldapscheme=%s", hba->ldapscheme));
+
 		if (hba->ldaptls)
 			options[noptions++] =
 				CStringGetTextDatum("ldaptls=true");
-- 
2.47.1

