From 731f58640688005edfaf981b446ae1392e1996ba Mon Sep 17 00:00:00 2001
From: Daniel Gustafsson <dgustafsson@postgresql.org>
Date: Thu, 9 Jul 2026 17:00:46 +0200
Subject: [PATCH] ssl: Include limits.h to get INT_MAX when using LibreSSL

When compiling against OpenSSL, the <limits.h> header is indirectly
included via openssl/ossl_typ.h from openssl/conf.h, but the LibreSSL
version of ossl_typ.h does not include <limits.h> which cause compiler
failure due to missing symbol (since ffd080d94fe).  Fix by explicitly
including <limits.h>.
---
 src/interfaces/libpq/fe-secure-openssl.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/interfaces/libpq/fe-secure-openssl.c b/src/interfaces/libpq/fe-secure-openssl.c
index f8b2184a1ce..c7651c98ab5 100644
--- a/src/interfaces/libpq/fe-secure-openssl.c
+++ b/src/interfaces/libpq/fe-secure-openssl.c
@@ -25,6 +25,7 @@
 #include <signal.h>
 #include <fcntl.h>
 #include <ctype.h>
+#include <limits.h>
 
 #include "libpq-fe.h"
 #include "fe-auth.h"
-- 
2.39.3 (Apple Git-146)

