agora inbox for [email protected]  
help / color / mirror / Atom feed
[PATCH v31 04/11] Add Incremental View Maintenance support to pg_dump
57+ messages / 2 participants
[nested] [flat]

* [PATCH v31 04/11] Add Incremental View Maintenance support to pg_dump
@ 2020-11-11 08:01 Yugo Nagata <[email protected]>
  0 siblings, 0 replies; 57+ messages in thread

From: Yugo Nagata @ 2020-11-11 08:01 UTC (permalink / raw)

Support CREATE INCREMENTAL MATERIALIZED VIEW syntax.
---
 src/bin/pg_dump/pg_dump.c        | 18 +++++++++++++++---
 src/bin/pg_dump/pg_dump.h        |  2 ++
 src/bin/pg_dump/t/002_pg_dump.pl | 18 ++++++++++++++++++
 3 files changed, 35 insertions(+), 3 deletions(-)

diff --git a/src/bin/pg_dump/pg_dump.c b/src/bin/pg_dump/pg_dump.c
index b1c4c3ec7f..92a8cbf244 100644
--- a/src/bin/pg_dump/pg_dump.c
+++ b/src/bin/pg_dump/pg_dump.c
@@ -6677,6 +6677,7 @@ getTables(Archive *fout, int *numTables)
 	int			i_relacl;
 	int			i_acldefault;
 	int			i_ispartition;
+	int			i_isivm;
 
 	/*
 	 * Find all the tables and table-like objects.
@@ -6779,10 +6780,17 @@ getTables(Archive *fout, int *numTables)
 
 	if (fout->remoteVersion >= 100000)
 		appendPQExpBufferStr(query,
-							 "c.relispartition AS ispartition ");
+							 "c.relispartition AS ispartition, ");
 	else
 		appendPQExpBufferStr(query,
-							 "false AS ispartition ");
+							 "false AS ispartition, ");
+
+	if (fout->remoteVersion >= 170000)
+		appendPQExpBufferStr(query,
+							 "c.relisivm AS isivm ");
+	else
+		appendPQExpBufferStr(query,
+							 "false AS isivm ");
 
 	/*
 	 * Left join to pg_depend to pick up dependency info linking sequences to
@@ -6891,6 +6899,7 @@ getTables(Archive *fout, int *numTables)
 	i_relacl = PQfnumber(res, "relacl");
 	i_acldefault = PQfnumber(res, "acldefault");
 	i_ispartition = PQfnumber(res, "ispartition");
+	i_isivm = PQfnumber(res, "isivm");
 
 	if (dopt->lockWaitTimeout)
 	{
@@ -6970,6 +6979,7 @@ getTables(Archive *fout, int *numTables)
 			tblinfo[i].amname = pg_strdup(PQgetvalue(res, i, i_amname));
 		tblinfo[i].is_identity_sequence = (strcmp(PQgetvalue(res, i, i_is_identity_sequence), "t") == 0);
 		tblinfo[i].ispartition = (strcmp(PQgetvalue(res, i, i_ispartition), "t") == 0);
+		tblinfo[i].isivm = (strcmp(PQgetvalue(res, i, i_isivm), "t") == 0);
 
 		/* other fields were zeroed above */
 
@@ -16023,9 +16033,11 @@ dumpTableSchema(Archive *fout, const TableInfo *tbinfo)
 			binary_upgrade_set_pg_class_oids(fout, q,
 											 tbinfo->dobj.catId.oid, false);
 
-		appendPQExpBuffer(q, "CREATE %s%s %s",
+		appendPQExpBuffer(q, "CREATE %s%s%s %s",
 						  tbinfo->relpersistence == RELPERSISTENCE_UNLOGGED ?
 						  "UNLOGGED " : "",
+						  tbinfo->relkind == RELKIND_MATVIEW && tbinfo->isivm ?
+						  "INCREMENTAL " : "",
 						  reltypename,
 						  qualrelname);
 
diff --git a/src/bin/pg_dump/pg_dump.h b/src/bin/pg_dump/pg_dump.h
index 9bc93520b4..4e240f8832 100644
--- a/src/bin/pg_dump/pg_dump.h
+++ b/src/bin/pg_dump/pg_dump.h
@@ -325,6 +325,8 @@ typedef struct _tableInfo
 	int			numParents;		/* number of (immediate) parent tables */
 	struct _tableInfo **parents;	/* TableInfos of immediate parents */
 
+	bool		isivm;			/* is incrementally maintainable materialized view? */
+
 	/*
 	 * These fields are computed only if we decide the table is interesting
 	 * (it's either a table to dump, or a direct parent of a dumpable table).
diff --git a/src/bin/pg_dump/t/002_pg_dump.pl b/src/bin/pg_dump/t/002_pg_dump.pl
index f0410ce6a1..a119ec8db1 100644
--- a/src/bin/pg_dump/t/002_pg_dump.pl
+++ b/src/bin/pg_dump/t/002_pg_dump.pl
@@ -2832,6 +2832,24 @@ my %tests = (
 		},
 	},
 
+	'CREATE MATERIALIZED VIEW matview_ivm' => {
+		create_order => 21,
+		create_sql   => 'CREATE INCREMENTAL MATERIALIZED VIEW dump_test.matview_ivm (col1) AS
+					   SELECT col1 FROM dump_test.test_table;',
+		regexp => qr/^
+			\QCREATE INCREMENTAL MATERIALIZED VIEW dump_test.matview_ivm AS\E
+			\n\s+\QSELECT col1\E
+			\n\s+\QFROM dump_test.test_table\E
+			\n\s+\QWITH NO DATA;\E
+			/xm,
+		like =>
+		  { %full_runs, %dump_test_schema_runs, section_pre_data => 1, },
+		unlike => {
+			exclude_dump_test_schema => 1,
+			only_dump_measurement => 1,
+		},
+	},
+
 	'CREATE POLICY p1 ON test_table' => {
 		create_order => 22,
 		create_sql => 'CREATE POLICY p1 ON dump_test.test_table
-- 
2.25.1


--Multipart=_Fri__29_Mar_2024_23_47_00_+0900_KGpmmDOIs1266Ib1
Content-Type: text/x-diff;
 name="v31-0005-Add-Incremental-View-Maintenance-support-to-psql.patch"
Content-Disposition: attachment;
 filename="v31-0005-Add-Incremental-View-Maintenance-support-to-psql.patch"
Content-Transfer-Encoding: 7bit



^ permalink  raw  reply  [nested|flat] 57+ messages in thread

* [PATCH v1 1/2] libpq-oauth: collapse use_builtin_flow() into a single definition
@ 2026-07-01 10:31 Jonathan Gonzalez V. <[email protected]>
  0 siblings, 0 replies; 57+ messages in thread

From: Jonathan Gonzalez V. @ 2026-07-01 10:31 UTC (permalink / raw)

There was three separated definition of the function making lcov v2.x fail
with an error.
---
 src/interfaces/libpq/fe-auth-oauth.c | 61 +++++++++++-----------------
 1 file changed, 24 insertions(+), 37 deletions(-)

diff --git a/src/interfaces/libpq/fe-auth-oauth.c b/src/interfaces/libpq/fe-auth-oauth.c
index 826f7461cb3..7a35647feb8 100644
--- a/src/interfaces/libpq/fe-auth-oauth.c
+++ b/src/interfaces/libpq/fe-auth-oauth.c
@@ -833,41 +833,42 @@ cleanup_oauth_flow(PGconn *conn)
  * failure, and positive indicates success.
  */
 
-#if !defined(USE_LIBCURL)
+#if defined(USE_LIBCURL) && defined(USE_DYNAMIC_OAUTH)
 
 /*
- * This configuration doesn't support the builtin flow.
+ * Use the builtin flow in the libpq-oauth plugin, which is loaded at runtime.
  */
 
-static int
-use_builtin_flow(PGconn *conn, fe_oauth_state *state, PGoauthBearerRequestV2 *request)
-{
-	return 0;
-}
+typedef char *(*libpq_gettext_func) (const char *msgid);
 
-#elif defined(USE_DYNAMIC_OAUTH)
+#elif defined(USE_LIBCURL)
 
 /*
- * Use the builtin flow in the libpq-oauth plugin, which is loaded at runtime.
+ * For static builds, we can just call pg_start_oauthbearer() directly. It's
+ * provided by libpq-oauth.a.
  */
+extern int	pg_start_oauthbearer(PGconn *conn, PGoauthBearerRequestV2 *request);
 
-typedef char *(*libpq_gettext_func) (const char *msgid);
+#endif
 
-/*
- * Loads the libpq-oauth plugin via dlopen(), initializes it, and plugs its
- * callbacks into the connection's async auth handlers.
- *
- * Failure to load here results in a relatively quiet connection error, to
- * handle the use case where the build supports loading a flow but a user does
- * not want to install it. Troubleshooting of linker/loader failures can be done
- * via PGOAUTHDEBUG.
- *
- * The lifetime of *request ends shortly after this call, so it must be copied
- * to longer-lived storage.
- */
 static int
 use_builtin_flow(PGconn *conn, fe_oauth_state *state, PGoauthBearerRequestV2 *request)
 {
+#if !defined(USE_LIBCURL)
+	return 0;
+#elif defined(USE_DYNAMIC_OAUTH)
+	/*
+	 * Load the libpq-oauth plugin via dlopen(), initialize it, and plug its
+	 * callbacks into the connection's async auth handlers.
+	 *
+	 * Failure to load here results in a relatively quiet connection error, to
+	 * handle the use case where the build supports loading a flow but a user
+	 * does not want to install it. Troubleshooting of linker/loader failures
+	 * can be done via PGOAUTHDEBUG.
+	 *
+	 * The lifetime of *request ends shortly after this call, so it must be
+	 * copied to longer-lived storage.
+	 */
 	static bool initialized = false;
 	static pthread_mutex_t init_mutex = PTHREAD_MUTEX_INITIALIZER;
 	int			lockerr;
@@ -976,24 +977,10 @@ use_builtin_flow(PGconn *conn, fe_oauth_state *state, PGoauthBearerRequestV2 *re
 	}
 
 	return (start_flow(conn, request) == 0) ? 1 : -1;
-}
-
 #else
-
-/*
- * For static builds, we can just call pg_start_oauthbearer() directly. It's
- * provided by libpq-oauth.a.
- */
-
-extern int	pg_start_oauthbearer(PGconn *conn, PGoauthBearerRequestV2 *request);
-
-static int
-use_builtin_flow(PGconn *conn, fe_oauth_state *state, PGoauthBearerRequestV2 *request)
-{
 	return (pg_start_oauthbearer(conn, request) == 0) ? 1 : -1;
-}
-
 #endif							/* USE_LIBCURL */
+}
 
 
 /*
-- 
2.53.0


--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
 filename=v1-0002-Collapse-SH_CREATE-into-a-single-definition.patch



^ permalink  raw  reply  [nested|flat] 57+ messages in thread

* [PATCH v1 1/2] libpq-oauth: collapse use_builtin_flow() into a single definition
@ 2026-07-01 10:31 Jonathan Gonzalez V. <[email protected]>
  0 siblings, 0 replies; 57+ messages in thread

From: Jonathan Gonzalez V. @ 2026-07-01 10:31 UTC (permalink / raw)

There was three separated definition of the function making lcov v2.x fail
with an error.
---
 src/interfaces/libpq/fe-auth-oauth.c | 61 +++++++++++-----------------
 1 file changed, 24 insertions(+), 37 deletions(-)

diff --git a/src/interfaces/libpq/fe-auth-oauth.c b/src/interfaces/libpq/fe-auth-oauth.c
index 826f7461cb3..7a35647feb8 100644
--- a/src/interfaces/libpq/fe-auth-oauth.c
+++ b/src/interfaces/libpq/fe-auth-oauth.c
@@ -833,41 +833,42 @@ cleanup_oauth_flow(PGconn *conn)
  * failure, and positive indicates success.
  */
 
-#if !defined(USE_LIBCURL)
+#if defined(USE_LIBCURL) && defined(USE_DYNAMIC_OAUTH)
 
 /*
- * This configuration doesn't support the builtin flow.
+ * Use the builtin flow in the libpq-oauth plugin, which is loaded at runtime.
  */
 
-static int
-use_builtin_flow(PGconn *conn, fe_oauth_state *state, PGoauthBearerRequestV2 *request)
-{
-	return 0;
-}
+typedef char *(*libpq_gettext_func) (const char *msgid);
 
-#elif defined(USE_DYNAMIC_OAUTH)
+#elif defined(USE_LIBCURL)
 
 /*
- * Use the builtin flow in the libpq-oauth plugin, which is loaded at runtime.
+ * For static builds, we can just call pg_start_oauthbearer() directly. It's
+ * provided by libpq-oauth.a.
  */
+extern int	pg_start_oauthbearer(PGconn *conn, PGoauthBearerRequestV2 *request);
 
-typedef char *(*libpq_gettext_func) (const char *msgid);
+#endif
 
-/*
- * Loads the libpq-oauth plugin via dlopen(), initializes it, and plugs its
- * callbacks into the connection's async auth handlers.
- *
- * Failure to load here results in a relatively quiet connection error, to
- * handle the use case where the build supports loading a flow but a user does
- * not want to install it. Troubleshooting of linker/loader failures can be done
- * via PGOAUTHDEBUG.
- *
- * The lifetime of *request ends shortly after this call, so it must be copied
- * to longer-lived storage.
- */
 static int
 use_builtin_flow(PGconn *conn, fe_oauth_state *state, PGoauthBearerRequestV2 *request)
 {
+#if !defined(USE_LIBCURL)
+	return 0;
+#elif defined(USE_DYNAMIC_OAUTH)
+	/*
+	 * Load the libpq-oauth plugin via dlopen(), initialize it, and plug its
+	 * callbacks into the connection's async auth handlers.
+	 *
+	 * Failure to load here results in a relatively quiet connection error, to
+	 * handle the use case where the build supports loading a flow but a user
+	 * does not want to install it. Troubleshooting of linker/loader failures
+	 * can be done via PGOAUTHDEBUG.
+	 *
+	 * The lifetime of *request ends shortly after this call, so it must be
+	 * copied to longer-lived storage.
+	 */
 	static bool initialized = false;
 	static pthread_mutex_t init_mutex = PTHREAD_MUTEX_INITIALIZER;
 	int			lockerr;
@@ -976,24 +977,10 @@ use_builtin_flow(PGconn *conn, fe_oauth_state *state, PGoauthBearerRequestV2 *re
 	}
 
 	return (start_flow(conn, request) == 0) ? 1 : -1;
-}
-
 #else
-
-/*
- * For static builds, we can just call pg_start_oauthbearer() directly. It's
- * provided by libpq-oauth.a.
- */
-
-extern int	pg_start_oauthbearer(PGconn *conn, PGoauthBearerRequestV2 *request);
-
-static int
-use_builtin_flow(PGconn *conn, fe_oauth_state *state, PGoauthBearerRequestV2 *request)
-{
 	return (pg_start_oauthbearer(conn, request) == 0) ? 1 : -1;
-}
-
 #endif							/* USE_LIBCURL */
+}
 
 
 /*
-- 
2.53.0


--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
 filename=v1-0002-Collapse-SH_CREATE-into-a-single-definition.patch



^ permalink  raw  reply  [nested|flat] 57+ messages in thread

* [PATCH v1 1/2] libpq-oauth: collapse use_builtin_flow() into a single definition
@ 2026-07-01 10:31 Jonathan Gonzalez V. <[email protected]>
  0 siblings, 0 replies; 57+ messages in thread

From: Jonathan Gonzalez V. @ 2026-07-01 10:31 UTC (permalink / raw)

There was three separated definition of the function making lcov v2.x fail
with an error.
---
 src/interfaces/libpq/fe-auth-oauth.c | 61 +++++++++++-----------------
 1 file changed, 24 insertions(+), 37 deletions(-)

diff --git a/src/interfaces/libpq/fe-auth-oauth.c b/src/interfaces/libpq/fe-auth-oauth.c
index 826f7461cb3..7a35647feb8 100644
--- a/src/interfaces/libpq/fe-auth-oauth.c
+++ b/src/interfaces/libpq/fe-auth-oauth.c
@@ -833,41 +833,42 @@ cleanup_oauth_flow(PGconn *conn)
  * failure, and positive indicates success.
  */
 
-#if !defined(USE_LIBCURL)
+#if defined(USE_LIBCURL) && defined(USE_DYNAMIC_OAUTH)
 
 /*
- * This configuration doesn't support the builtin flow.
+ * Use the builtin flow in the libpq-oauth plugin, which is loaded at runtime.
  */
 
-static int
-use_builtin_flow(PGconn *conn, fe_oauth_state *state, PGoauthBearerRequestV2 *request)
-{
-	return 0;
-}
+typedef char *(*libpq_gettext_func) (const char *msgid);
 
-#elif defined(USE_DYNAMIC_OAUTH)
+#elif defined(USE_LIBCURL)
 
 /*
- * Use the builtin flow in the libpq-oauth plugin, which is loaded at runtime.
+ * For static builds, we can just call pg_start_oauthbearer() directly. It's
+ * provided by libpq-oauth.a.
  */
+extern int	pg_start_oauthbearer(PGconn *conn, PGoauthBearerRequestV2 *request);
 
-typedef char *(*libpq_gettext_func) (const char *msgid);
+#endif
 
-/*
- * Loads the libpq-oauth plugin via dlopen(), initializes it, and plugs its
- * callbacks into the connection's async auth handlers.
- *
- * Failure to load here results in a relatively quiet connection error, to
- * handle the use case where the build supports loading a flow but a user does
- * not want to install it. Troubleshooting of linker/loader failures can be done
- * via PGOAUTHDEBUG.
- *
- * The lifetime of *request ends shortly after this call, so it must be copied
- * to longer-lived storage.
- */
 static int
 use_builtin_flow(PGconn *conn, fe_oauth_state *state, PGoauthBearerRequestV2 *request)
 {
+#if !defined(USE_LIBCURL)
+	return 0;
+#elif defined(USE_DYNAMIC_OAUTH)
+	/*
+	 * Load the libpq-oauth plugin via dlopen(), initialize it, and plug its
+	 * callbacks into the connection's async auth handlers.
+	 *
+	 * Failure to load here results in a relatively quiet connection error, to
+	 * handle the use case where the build supports loading a flow but a user
+	 * does not want to install it. Troubleshooting of linker/loader failures
+	 * can be done via PGOAUTHDEBUG.
+	 *
+	 * The lifetime of *request ends shortly after this call, so it must be
+	 * copied to longer-lived storage.
+	 */
 	static bool initialized = false;
 	static pthread_mutex_t init_mutex = PTHREAD_MUTEX_INITIALIZER;
 	int			lockerr;
@@ -976,24 +977,10 @@ use_builtin_flow(PGconn *conn, fe_oauth_state *state, PGoauthBearerRequestV2 *re
 	}
 
 	return (start_flow(conn, request) == 0) ? 1 : -1;
-}
-
 #else
-
-/*
- * For static builds, we can just call pg_start_oauthbearer() directly. It's
- * provided by libpq-oauth.a.
- */
-
-extern int	pg_start_oauthbearer(PGconn *conn, PGoauthBearerRequestV2 *request);
-
-static int
-use_builtin_flow(PGconn *conn, fe_oauth_state *state, PGoauthBearerRequestV2 *request)
-{
 	return (pg_start_oauthbearer(conn, request) == 0) ? 1 : -1;
-}
-
 #endif							/* USE_LIBCURL */
+}
 
 
 /*
-- 
2.53.0


--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
 filename=v1-0002-Collapse-SH_CREATE-into-a-single-definition.patch



^ permalink  raw  reply  [nested|flat] 57+ messages in thread

* [PATCH v1 1/2] libpq-oauth: collapse use_builtin_flow() into a single definition
@ 2026-07-01 10:31 Jonathan Gonzalez V. <[email protected]>
  0 siblings, 0 replies; 57+ messages in thread

From: Jonathan Gonzalez V. @ 2026-07-01 10:31 UTC (permalink / raw)

There was three separated definition of the function making lcov v2.x fail
with an error.
---
 src/interfaces/libpq/fe-auth-oauth.c | 61 +++++++++++-----------------
 1 file changed, 24 insertions(+), 37 deletions(-)

diff --git a/src/interfaces/libpq/fe-auth-oauth.c b/src/interfaces/libpq/fe-auth-oauth.c
index 826f7461cb3..7a35647feb8 100644
--- a/src/interfaces/libpq/fe-auth-oauth.c
+++ b/src/interfaces/libpq/fe-auth-oauth.c
@@ -833,41 +833,42 @@ cleanup_oauth_flow(PGconn *conn)
  * failure, and positive indicates success.
  */
 
-#if !defined(USE_LIBCURL)
+#if defined(USE_LIBCURL) && defined(USE_DYNAMIC_OAUTH)
 
 /*
- * This configuration doesn't support the builtin flow.
+ * Use the builtin flow in the libpq-oauth plugin, which is loaded at runtime.
  */
 
-static int
-use_builtin_flow(PGconn *conn, fe_oauth_state *state, PGoauthBearerRequestV2 *request)
-{
-	return 0;
-}
+typedef char *(*libpq_gettext_func) (const char *msgid);
 
-#elif defined(USE_DYNAMIC_OAUTH)
+#elif defined(USE_LIBCURL)
 
 /*
- * Use the builtin flow in the libpq-oauth plugin, which is loaded at runtime.
+ * For static builds, we can just call pg_start_oauthbearer() directly. It's
+ * provided by libpq-oauth.a.
  */
+extern int	pg_start_oauthbearer(PGconn *conn, PGoauthBearerRequestV2 *request);
 
-typedef char *(*libpq_gettext_func) (const char *msgid);
+#endif
 
-/*
- * Loads the libpq-oauth plugin via dlopen(), initializes it, and plugs its
- * callbacks into the connection's async auth handlers.
- *
- * Failure to load here results in a relatively quiet connection error, to
- * handle the use case where the build supports loading a flow but a user does
- * not want to install it. Troubleshooting of linker/loader failures can be done
- * via PGOAUTHDEBUG.
- *
- * The lifetime of *request ends shortly after this call, so it must be copied
- * to longer-lived storage.
- */
 static int
 use_builtin_flow(PGconn *conn, fe_oauth_state *state, PGoauthBearerRequestV2 *request)
 {
+#if !defined(USE_LIBCURL)
+	return 0;
+#elif defined(USE_DYNAMIC_OAUTH)
+	/*
+	 * Load the libpq-oauth plugin via dlopen(), initialize it, and plug its
+	 * callbacks into the connection's async auth handlers.
+	 *
+	 * Failure to load here results in a relatively quiet connection error, to
+	 * handle the use case where the build supports loading a flow but a user
+	 * does not want to install it. Troubleshooting of linker/loader failures
+	 * can be done via PGOAUTHDEBUG.
+	 *
+	 * The lifetime of *request ends shortly after this call, so it must be
+	 * copied to longer-lived storage.
+	 */
 	static bool initialized = false;
 	static pthread_mutex_t init_mutex = PTHREAD_MUTEX_INITIALIZER;
 	int			lockerr;
@@ -976,24 +977,10 @@ use_builtin_flow(PGconn *conn, fe_oauth_state *state, PGoauthBearerRequestV2 *re
 	}
 
 	return (start_flow(conn, request) == 0) ? 1 : -1;
-}
-
 #else
-
-/*
- * For static builds, we can just call pg_start_oauthbearer() directly. It's
- * provided by libpq-oauth.a.
- */
-
-extern int	pg_start_oauthbearer(PGconn *conn, PGoauthBearerRequestV2 *request);
-
-static int
-use_builtin_flow(PGconn *conn, fe_oauth_state *state, PGoauthBearerRequestV2 *request)
-{
 	return (pg_start_oauthbearer(conn, request) == 0) ? 1 : -1;
-}
-
 #endif							/* USE_LIBCURL */
+}
 
 
 /*
-- 
2.53.0


--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
 filename=v1-0002-Collapse-SH_CREATE-into-a-single-definition.patch



^ permalink  raw  reply  [nested|flat] 57+ messages in thread

* [PATCH v1 1/2] libpq-oauth: collapse use_builtin_flow() into a single definition
@ 2026-07-01 10:31 Jonathan Gonzalez V. <[email protected]>
  0 siblings, 0 replies; 57+ messages in thread

From: Jonathan Gonzalez V. @ 2026-07-01 10:31 UTC (permalink / raw)

There was three separated definition of the function making lcov v2.x fail
with an error.
---
 src/interfaces/libpq/fe-auth-oauth.c | 61 +++++++++++-----------------
 1 file changed, 24 insertions(+), 37 deletions(-)

diff --git a/src/interfaces/libpq/fe-auth-oauth.c b/src/interfaces/libpq/fe-auth-oauth.c
index 826f7461cb3..7a35647feb8 100644
--- a/src/interfaces/libpq/fe-auth-oauth.c
+++ b/src/interfaces/libpq/fe-auth-oauth.c
@@ -833,41 +833,42 @@ cleanup_oauth_flow(PGconn *conn)
  * failure, and positive indicates success.
  */
 
-#if !defined(USE_LIBCURL)
+#if defined(USE_LIBCURL) && defined(USE_DYNAMIC_OAUTH)
 
 /*
- * This configuration doesn't support the builtin flow.
+ * Use the builtin flow in the libpq-oauth plugin, which is loaded at runtime.
  */
 
-static int
-use_builtin_flow(PGconn *conn, fe_oauth_state *state, PGoauthBearerRequestV2 *request)
-{
-	return 0;
-}
+typedef char *(*libpq_gettext_func) (const char *msgid);
 
-#elif defined(USE_DYNAMIC_OAUTH)
+#elif defined(USE_LIBCURL)
 
 /*
- * Use the builtin flow in the libpq-oauth plugin, which is loaded at runtime.
+ * For static builds, we can just call pg_start_oauthbearer() directly. It's
+ * provided by libpq-oauth.a.
  */
+extern int	pg_start_oauthbearer(PGconn *conn, PGoauthBearerRequestV2 *request);
 
-typedef char *(*libpq_gettext_func) (const char *msgid);
+#endif
 
-/*
- * Loads the libpq-oauth plugin via dlopen(), initializes it, and plugs its
- * callbacks into the connection's async auth handlers.
- *
- * Failure to load here results in a relatively quiet connection error, to
- * handle the use case where the build supports loading a flow but a user does
- * not want to install it. Troubleshooting of linker/loader failures can be done
- * via PGOAUTHDEBUG.
- *
- * The lifetime of *request ends shortly after this call, so it must be copied
- * to longer-lived storage.
- */
 static int
 use_builtin_flow(PGconn *conn, fe_oauth_state *state, PGoauthBearerRequestV2 *request)
 {
+#if !defined(USE_LIBCURL)
+	return 0;
+#elif defined(USE_DYNAMIC_OAUTH)
+	/*
+	 * Load the libpq-oauth plugin via dlopen(), initialize it, and plug its
+	 * callbacks into the connection's async auth handlers.
+	 *
+	 * Failure to load here results in a relatively quiet connection error, to
+	 * handle the use case where the build supports loading a flow but a user
+	 * does not want to install it. Troubleshooting of linker/loader failures
+	 * can be done via PGOAUTHDEBUG.
+	 *
+	 * The lifetime of *request ends shortly after this call, so it must be
+	 * copied to longer-lived storage.
+	 */
 	static bool initialized = false;
 	static pthread_mutex_t init_mutex = PTHREAD_MUTEX_INITIALIZER;
 	int			lockerr;
@@ -976,24 +977,10 @@ use_builtin_flow(PGconn *conn, fe_oauth_state *state, PGoauthBearerRequestV2 *re
 	}
 
 	return (start_flow(conn, request) == 0) ? 1 : -1;
-}
-
 #else
-
-/*
- * For static builds, we can just call pg_start_oauthbearer() directly. It's
- * provided by libpq-oauth.a.
- */
-
-extern int	pg_start_oauthbearer(PGconn *conn, PGoauthBearerRequestV2 *request);
-
-static int
-use_builtin_flow(PGconn *conn, fe_oauth_state *state, PGoauthBearerRequestV2 *request)
-{
 	return (pg_start_oauthbearer(conn, request) == 0) ? 1 : -1;
-}
-
 #endif							/* USE_LIBCURL */
+}
 
 
 /*
-- 
2.53.0


--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
 filename=v1-0002-Collapse-SH_CREATE-into-a-single-definition.patch



^ permalink  raw  reply  [nested|flat] 57+ messages in thread

* [PATCH v1 1/2] libpq-oauth: collapse use_builtin_flow() into a single definition
@ 2026-07-01 10:31 Jonathan Gonzalez V. <[email protected]>
  0 siblings, 0 replies; 57+ messages in thread

From: Jonathan Gonzalez V. @ 2026-07-01 10:31 UTC (permalink / raw)

There was three separated definition of the function making lcov v2.x fail
with an error.
---
 src/interfaces/libpq/fe-auth-oauth.c | 61 +++++++++++-----------------
 1 file changed, 24 insertions(+), 37 deletions(-)

diff --git a/src/interfaces/libpq/fe-auth-oauth.c b/src/interfaces/libpq/fe-auth-oauth.c
index 826f7461cb3..7a35647feb8 100644
--- a/src/interfaces/libpq/fe-auth-oauth.c
+++ b/src/interfaces/libpq/fe-auth-oauth.c
@@ -833,41 +833,42 @@ cleanup_oauth_flow(PGconn *conn)
  * failure, and positive indicates success.
  */
 
-#if !defined(USE_LIBCURL)
+#if defined(USE_LIBCURL) && defined(USE_DYNAMIC_OAUTH)
 
 /*
- * This configuration doesn't support the builtin flow.
+ * Use the builtin flow in the libpq-oauth plugin, which is loaded at runtime.
  */
 
-static int
-use_builtin_flow(PGconn *conn, fe_oauth_state *state, PGoauthBearerRequestV2 *request)
-{
-	return 0;
-}
+typedef char *(*libpq_gettext_func) (const char *msgid);
 
-#elif defined(USE_DYNAMIC_OAUTH)
+#elif defined(USE_LIBCURL)
 
 /*
- * Use the builtin flow in the libpq-oauth plugin, which is loaded at runtime.
+ * For static builds, we can just call pg_start_oauthbearer() directly. It's
+ * provided by libpq-oauth.a.
  */
+extern int	pg_start_oauthbearer(PGconn *conn, PGoauthBearerRequestV2 *request);
 
-typedef char *(*libpq_gettext_func) (const char *msgid);
+#endif
 
-/*
- * Loads the libpq-oauth plugin via dlopen(), initializes it, and plugs its
- * callbacks into the connection's async auth handlers.
- *
- * Failure to load here results in a relatively quiet connection error, to
- * handle the use case where the build supports loading a flow but a user does
- * not want to install it. Troubleshooting of linker/loader failures can be done
- * via PGOAUTHDEBUG.
- *
- * The lifetime of *request ends shortly after this call, so it must be copied
- * to longer-lived storage.
- */
 static int
 use_builtin_flow(PGconn *conn, fe_oauth_state *state, PGoauthBearerRequestV2 *request)
 {
+#if !defined(USE_LIBCURL)
+	return 0;
+#elif defined(USE_DYNAMIC_OAUTH)
+	/*
+	 * Load the libpq-oauth plugin via dlopen(), initialize it, and plug its
+	 * callbacks into the connection's async auth handlers.
+	 *
+	 * Failure to load here results in a relatively quiet connection error, to
+	 * handle the use case where the build supports loading a flow but a user
+	 * does not want to install it. Troubleshooting of linker/loader failures
+	 * can be done via PGOAUTHDEBUG.
+	 *
+	 * The lifetime of *request ends shortly after this call, so it must be
+	 * copied to longer-lived storage.
+	 */
 	static bool initialized = false;
 	static pthread_mutex_t init_mutex = PTHREAD_MUTEX_INITIALIZER;
 	int			lockerr;
@@ -976,24 +977,10 @@ use_builtin_flow(PGconn *conn, fe_oauth_state *state, PGoauthBearerRequestV2 *re
 	}
 
 	return (start_flow(conn, request) == 0) ? 1 : -1;
-}
-
 #else
-
-/*
- * For static builds, we can just call pg_start_oauthbearer() directly. It's
- * provided by libpq-oauth.a.
- */
-
-extern int	pg_start_oauthbearer(PGconn *conn, PGoauthBearerRequestV2 *request);
-
-static int
-use_builtin_flow(PGconn *conn, fe_oauth_state *state, PGoauthBearerRequestV2 *request)
-{
 	return (pg_start_oauthbearer(conn, request) == 0) ? 1 : -1;
-}
-
 #endif							/* USE_LIBCURL */
+}
 
 
 /*
-- 
2.53.0


--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
 filename=v1-0002-Collapse-SH_CREATE-into-a-single-definition.patch



^ permalink  raw  reply  [nested|flat] 57+ messages in thread

* [PATCH v1 1/2] libpq-oauth: collapse use_builtin_flow() into a single definition
@ 2026-07-01 10:31 Jonathan Gonzalez V. <[email protected]>
  0 siblings, 0 replies; 57+ messages in thread

From: Jonathan Gonzalez V. @ 2026-07-01 10:31 UTC (permalink / raw)

There was three separated definition of the function making lcov v2.x fail
with an error.
---
 src/interfaces/libpq/fe-auth-oauth.c | 61 +++++++++++-----------------
 1 file changed, 24 insertions(+), 37 deletions(-)

diff --git a/src/interfaces/libpq/fe-auth-oauth.c b/src/interfaces/libpq/fe-auth-oauth.c
index 826f7461cb3..7a35647feb8 100644
--- a/src/interfaces/libpq/fe-auth-oauth.c
+++ b/src/interfaces/libpq/fe-auth-oauth.c
@@ -833,41 +833,42 @@ cleanup_oauth_flow(PGconn *conn)
  * failure, and positive indicates success.
  */
 
-#if !defined(USE_LIBCURL)
+#if defined(USE_LIBCURL) && defined(USE_DYNAMIC_OAUTH)
 
 /*
- * This configuration doesn't support the builtin flow.
+ * Use the builtin flow in the libpq-oauth plugin, which is loaded at runtime.
  */
 
-static int
-use_builtin_flow(PGconn *conn, fe_oauth_state *state, PGoauthBearerRequestV2 *request)
-{
-	return 0;
-}
+typedef char *(*libpq_gettext_func) (const char *msgid);
 
-#elif defined(USE_DYNAMIC_OAUTH)
+#elif defined(USE_LIBCURL)
 
 /*
- * Use the builtin flow in the libpq-oauth plugin, which is loaded at runtime.
+ * For static builds, we can just call pg_start_oauthbearer() directly. It's
+ * provided by libpq-oauth.a.
  */
+extern int	pg_start_oauthbearer(PGconn *conn, PGoauthBearerRequestV2 *request);
 
-typedef char *(*libpq_gettext_func) (const char *msgid);
+#endif
 
-/*
- * Loads the libpq-oauth plugin via dlopen(), initializes it, and plugs its
- * callbacks into the connection's async auth handlers.
- *
- * Failure to load here results in a relatively quiet connection error, to
- * handle the use case where the build supports loading a flow but a user does
- * not want to install it. Troubleshooting of linker/loader failures can be done
- * via PGOAUTHDEBUG.
- *
- * The lifetime of *request ends shortly after this call, so it must be copied
- * to longer-lived storage.
- */
 static int
 use_builtin_flow(PGconn *conn, fe_oauth_state *state, PGoauthBearerRequestV2 *request)
 {
+#if !defined(USE_LIBCURL)
+	return 0;
+#elif defined(USE_DYNAMIC_OAUTH)
+	/*
+	 * Load the libpq-oauth plugin via dlopen(), initialize it, and plug its
+	 * callbacks into the connection's async auth handlers.
+	 *
+	 * Failure to load here results in a relatively quiet connection error, to
+	 * handle the use case where the build supports loading a flow but a user
+	 * does not want to install it. Troubleshooting of linker/loader failures
+	 * can be done via PGOAUTHDEBUG.
+	 *
+	 * The lifetime of *request ends shortly after this call, so it must be
+	 * copied to longer-lived storage.
+	 */
 	static bool initialized = false;
 	static pthread_mutex_t init_mutex = PTHREAD_MUTEX_INITIALIZER;
 	int			lockerr;
@@ -976,24 +977,10 @@ use_builtin_flow(PGconn *conn, fe_oauth_state *state, PGoauthBearerRequestV2 *re
 	}
 
 	return (start_flow(conn, request) == 0) ? 1 : -1;
-}
-
 #else
-
-/*
- * For static builds, we can just call pg_start_oauthbearer() directly. It's
- * provided by libpq-oauth.a.
- */
-
-extern int	pg_start_oauthbearer(PGconn *conn, PGoauthBearerRequestV2 *request);
-
-static int
-use_builtin_flow(PGconn *conn, fe_oauth_state *state, PGoauthBearerRequestV2 *request)
-{
 	return (pg_start_oauthbearer(conn, request) == 0) ? 1 : -1;
-}
-
 #endif							/* USE_LIBCURL */
+}
 
 
 /*
-- 
2.53.0


--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
 filename=v1-0002-Collapse-SH_CREATE-into-a-single-definition.patch



^ permalink  raw  reply  [nested|flat] 57+ messages in thread

* [PATCH v1 1/2] libpq-oauth: collapse use_builtin_flow() into a single definition
@ 2026-07-01 10:31 Jonathan Gonzalez V. <[email protected]>
  0 siblings, 0 replies; 57+ messages in thread

From: Jonathan Gonzalez V. @ 2026-07-01 10:31 UTC (permalink / raw)

There was three separated definition of the function making lcov v2.x fail
with an error.
---
 src/interfaces/libpq/fe-auth-oauth.c | 61 +++++++++++-----------------
 1 file changed, 24 insertions(+), 37 deletions(-)

diff --git a/src/interfaces/libpq/fe-auth-oauth.c b/src/interfaces/libpq/fe-auth-oauth.c
index 826f7461cb3..7a35647feb8 100644
--- a/src/interfaces/libpq/fe-auth-oauth.c
+++ b/src/interfaces/libpq/fe-auth-oauth.c
@@ -833,41 +833,42 @@ cleanup_oauth_flow(PGconn *conn)
  * failure, and positive indicates success.
  */
 
-#if !defined(USE_LIBCURL)
+#if defined(USE_LIBCURL) && defined(USE_DYNAMIC_OAUTH)
 
 /*
- * This configuration doesn't support the builtin flow.
+ * Use the builtin flow in the libpq-oauth plugin, which is loaded at runtime.
  */
 
-static int
-use_builtin_flow(PGconn *conn, fe_oauth_state *state, PGoauthBearerRequestV2 *request)
-{
-	return 0;
-}
+typedef char *(*libpq_gettext_func) (const char *msgid);
 
-#elif defined(USE_DYNAMIC_OAUTH)
+#elif defined(USE_LIBCURL)
 
 /*
- * Use the builtin flow in the libpq-oauth plugin, which is loaded at runtime.
+ * For static builds, we can just call pg_start_oauthbearer() directly. It's
+ * provided by libpq-oauth.a.
  */
+extern int	pg_start_oauthbearer(PGconn *conn, PGoauthBearerRequestV2 *request);
 
-typedef char *(*libpq_gettext_func) (const char *msgid);
+#endif
 
-/*
- * Loads the libpq-oauth plugin via dlopen(), initializes it, and plugs its
- * callbacks into the connection's async auth handlers.
- *
- * Failure to load here results in a relatively quiet connection error, to
- * handle the use case where the build supports loading a flow but a user does
- * not want to install it. Troubleshooting of linker/loader failures can be done
- * via PGOAUTHDEBUG.
- *
- * The lifetime of *request ends shortly after this call, so it must be copied
- * to longer-lived storage.
- */
 static int
 use_builtin_flow(PGconn *conn, fe_oauth_state *state, PGoauthBearerRequestV2 *request)
 {
+#if !defined(USE_LIBCURL)
+	return 0;
+#elif defined(USE_DYNAMIC_OAUTH)
+	/*
+	 * Load the libpq-oauth plugin via dlopen(), initialize it, and plug its
+	 * callbacks into the connection's async auth handlers.
+	 *
+	 * Failure to load here results in a relatively quiet connection error, to
+	 * handle the use case where the build supports loading a flow but a user
+	 * does not want to install it. Troubleshooting of linker/loader failures
+	 * can be done via PGOAUTHDEBUG.
+	 *
+	 * The lifetime of *request ends shortly after this call, so it must be
+	 * copied to longer-lived storage.
+	 */
 	static bool initialized = false;
 	static pthread_mutex_t init_mutex = PTHREAD_MUTEX_INITIALIZER;
 	int			lockerr;
@@ -976,24 +977,10 @@ use_builtin_flow(PGconn *conn, fe_oauth_state *state, PGoauthBearerRequestV2 *re
 	}
 
 	return (start_flow(conn, request) == 0) ? 1 : -1;
-}
-
 #else
-
-/*
- * For static builds, we can just call pg_start_oauthbearer() directly. It's
- * provided by libpq-oauth.a.
- */
-
-extern int	pg_start_oauthbearer(PGconn *conn, PGoauthBearerRequestV2 *request);
-
-static int
-use_builtin_flow(PGconn *conn, fe_oauth_state *state, PGoauthBearerRequestV2 *request)
-{
 	return (pg_start_oauthbearer(conn, request) == 0) ? 1 : -1;
-}
-
 #endif							/* USE_LIBCURL */
+}
 
 
 /*
-- 
2.53.0


--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
 filename=v1-0002-Collapse-SH_CREATE-into-a-single-definition.patch



^ permalink  raw  reply  [nested|flat] 57+ messages in thread

* [PATCH v1 1/2] libpq-oauth: collapse use_builtin_flow() into a single definition
@ 2026-07-01 10:31 Jonathan Gonzalez V. <[email protected]>
  0 siblings, 0 replies; 57+ messages in thread

From: Jonathan Gonzalez V. @ 2026-07-01 10:31 UTC (permalink / raw)

There was three separated definition of the function making lcov v2.x fail
with an error.
---
 src/interfaces/libpq/fe-auth-oauth.c | 61 +++++++++++-----------------
 1 file changed, 24 insertions(+), 37 deletions(-)

diff --git a/src/interfaces/libpq/fe-auth-oauth.c b/src/interfaces/libpq/fe-auth-oauth.c
index 826f7461cb3..7a35647feb8 100644
--- a/src/interfaces/libpq/fe-auth-oauth.c
+++ b/src/interfaces/libpq/fe-auth-oauth.c
@@ -833,41 +833,42 @@ cleanup_oauth_flow(PGconn *conn)
  * failure, and positive indicates success.
  */
 
-#if !defined(USE_LIBCURL)
+#if defined(USE_LIBCURL) && defined(USE_DYNAMIC_OAUTH)
 
 /*
- * This configuration doesn't support the builtin flow.
+ * Use the builtin flow in the libpq-oauth plugin, which is loaded at runtime.
  */
 
-static int
-use_builtin_flow(PGconn *conn, fe_oauth_state *state, PGoauthBearerRequestV2 *request)
-{
-	return 0;
-}
+typedef char *(*libpq_gettext_func) (const char *msgid);
 
-#elif defined(USE_DYNAMIC_OAUTH)
+#elif defined(USE_LIBCURL)
 
 /*
- * Use the builtin flow in the libpq-oauth plugin, which is loaded at runtime.
+ * For static builds, we can just call pg_start_oauthbearer() directly. It's
+ * provided by libpq-oauth.a.
  */
+extern int	pg_start_oauthbearer(PGconn *conn, PGoauthBearerRequestV2 *request);
 
-typedef char *(*libpq_gettext_func) (const char *msgid);
+#endif
 
-/*
- * Loads the libpq-oauth plugin via dlopen(), initializes it, and plugs its
- * callbacks into the connection's async auth handlers.
- *
- * Failure to load here results in a relatively quiet connection error, to
- * handle the use case where the build supports loading a flow but a user does
- * not want to install it. Troubleshooting of linker/loader failures can be done
- * via PGOAUTHDEBUG.
- *
- * The lifetime of *request ends shortly after this call, so it must be copied
- * to longer-lived storage.
- */
 static int
 use_builtin_flow(PGconn *conn, fe_oauth_state *state, PGoauthBearerRequestV2 *request)
 {
+#if !defined(USE_LIBCURL)
+	return 0;
+#elif defined(USE_DYNAMIC_OAUTH)
+	/*
+	 * Load the libpq-oauth plugin via dlopen(), initialize it, and plug its
+	 * callbacks into the connection's async auth handlers.
+	 *
+	 * Failure to load here results in a relatively quiet connection error, to
+	 * handle the use case where the build supports loading a flow but a user
+	 * does not want to install it. Troubleshooting of linker/loader failures
+	 * can be done via PGOAUTHDEBUG.
+	 *
+	 * The lifetime of *request ends shortly after this call, so it must be
+	 * copied to longer-lived storage.
+	 */
 	static bool initialized = false;
 	static pthread_mutex_t init_mutex = PTHREAD_MUTEX_INITIALIZER;
 	int			lockerr;
@@ -976,24 +977,10 @@ use_builtin_flow(PGconn *conn, fe_oauth_state *state, PGoauthBearerRequestV2 *re
 	}
 
 	return (start_flow(conn, request) == 0) ? 1 : -1;
-}
-
 #else
-
-/*
- * For static builds, we can just call pg_start_oauthbearer() directly. It's
- * provided by libpq-oauth.a.
- */
-
-extern int	pg_start_oauthbearer(PGconn *conn, PGoauthBearerRequestV2 *request);
-
-static int
-use_builtin_flow(PGconn *conn, fe_oauth_state *state, PGoauthBearerRequestV2 *request)
-{
 	return (pg_start_oauthbearer(conn, request) == 0) ? 1 : -1;
-}
-
 #endif							/* USE_LIBCURL */
+}
 
 
 /*
-- 
2.53.0


--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
 filename=v1-0002-Collapse-SH_CREATE-into-a-single-definition.patch



^ permalink  raw  reply  [nested|flat] 57+ messages in thread

* [PATCH v1 1/2] libpq-oauth: collapse use_builtin_flow() into a single definition
@ 2026-07-01 10:31 Jonathan Gonzalez V. <[email protected]>
  0 siblings, 0 replies; 57+ messages in thread

From: Jonathan Gonzalez V. @ 2026-07-01 10:31 UTC (permalink / raw)

There was three separated definition of the function making lcov v2.x fail
with an error.
---
 src/interfaces/libpq/fe-auth-oauth.c | 61 +++++++++++-----------------
 1 file changed, 24 insertions(+), 37 deletions(-)

diff --git a/src/interfaces/libpq/fe-auth-oauth.c b/src/interfaces/libpq/fe-auth-oauth.c
index 826f7461cb3..7a35647feb8 100644
--- a/src/interfaces/libpq/fe-auth-oauth.c
+++ b/src/interfaces/libpq/fe-auth-oauth.c
@@ -833,41 +833,42 @@ cleanup_oauth_flow(PGconn *conn)
  * failure, and positive indicates success.
  */
 
-#if !defined(USE_LIBCURL)
+#if defined(USE_LIBCURL) && defined(USE_DYNAMIC_OAUTH)
 
 /*
- * This configuration doesn't support the builtin flow.
+ * Use the builtin flow in the libpq-oauth plugin, which is loaded at runtime.
  */
 
-static int
-use_builtin_flow(PGconn *conn, fe_oauth_state *state, PGoauthBearerRequestV2 *request)
-{
-	return 0;
-}
+typedef char *(*libpq_gettext_func) (const char *msgid);
 
-#elif defined(USE_DYNAMIC_OAUTH)
+#elif defined(USE_LIBCURL)
 
 /*
- * Use the builtin flow in the libpq-oauth plugin, which is loaded at runtime.
+ * For static builds, we can just call pg_start_oauthbearer() directly. It's
+ * provided by libpq-oauth.a.
  */
+extern int	pg_start_oauthbearer(PGconn *conn, PGoauthBearerRequestV2 *request);
 
-typedef char *(*libpq_gettext_func) (const char *msgid);
+#endif
 
-/*
- * Loads the libpq-oauth plugin via dlopen(), initializes it, and plugs its
- * callbacks into the connection's async auth handlers.
- *
- * Failure to load here results in a relatively quiet connection error, to
- * handle the use case where the build supports loading a flow but a user does
- * not want to install it. Troubleshooting of linker/loader failures can be done
- * via PGOAUTHDEBUG.
- *
- * The lifetime of *request ends shortly after this call, so it must be copied
- * to longer-lived storage.
- */
 static int
 use_builtin_flow(PGconn *conn, fe_oauth_state *state, PGoauthBearerRequestV2 *request)
 {
+#if !defined(USE_LIBCURL)
+	return 0;
+#elif defined(USE_DYNAMIC_OAUTH)
+	/*
+	 * Load the libpq-oauth plugin via dlopen(), initialize it, and plug its
+	 * callbacks into the connection's async auth handlers.
+	 *
+	 * Failure to load here results in a relatively quiet connection error, to
+	 * handle the use case where the build supports loading a flow but a user
+	 * does not want to install it. Troubleshooting of linker/loader failures
+	 * can be done via PGOAUTHDEBUG.
+	 *
+	 * The lifetime of *request ends shortly after this call, so it must be
+	 * copied to longer-lived storage.
+	 */
 	static bool initialized = false;
 	static pthread_mutex_t init_mutex = PTHREAD_MUTEX_INITIALIZER;
 	int			lockerr;
@@ -976,24 +977,10 @@ use_builtin_flow(PGconn *conn, fe_oauth_state *state, PGoauthBearerRequestV2 *re
 	}
 
 	return (start_flow(conn, request) == 0) ? 1 : -1;
-}
-
 #else
-
-/*
- * For static builds, we can just call pg_start_oauthbearer() directly. It's
- * provided by libpq-oauth.a.
- */
-
-extern int	pg_start_oauthbearer(PGconn *conn, PGoauthBearerRequestV2 *request);
-
-static int
-use_builtin_flow(PGconn *conn, fe_oauth_state *state, PGoauthBearerRequestV2 *request)
-{
 	return (pg_start_oauthbearer(conn, request) == 0) ? 1 : -1;
-}
-
 #endif							/* USE_LIBCURL */
+}
 
 
 /*
-- 
2.53.0


--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
 filename=v1-0002-Collapse-SH_CREATE-into-a-single-definition.patch



^ permalink  raw  reply  [nested|flat] 57+ messages in thread

* [PATCH v1 1/2] libpq-oauth: collapse use_builtin_flow() into a single definition
@ 2026-07-01 10:31 Jonathan Gonzalez V. <[email protected]>
  0 siblings, 0 replies; 57+ messages in thread

From: Jonathan Gonzalez V. @ 2026-07-01 10:31 UTC (permalink / raw)

There was three separated definition of the function making lcov v2.x fail
with an error.
---
 src/interfaces/libpq/fe-auth-oauth.c | 61 +++++++++++-----------------
 1 file changed, 24 insertions(+), 37 deletions(-)

diff --git a/src/interfaces/libpq/fe-auth-oauth.c b/src/interfaces/libpq/fe-auth-oauth.c
index 826f7461cb3..7a35647feb8 100644
--- a/src/interfaces/libpq/fe-auth-oauth.c
+++ b/src/interfaces/libpq/fe-auth-oauth.c
@@ -833,41 +833,42 @@ cleanup_oauth_flow(PGconn *conn)
  * failure, and positive indicates success.
  */
 
-#if !defined(USE_LIBCURL)
+#if defined(USE_LIBCURL) && defined(USE_DYNAMIC_OAUTH)
 
 /*
- * This configuration doesn't support the builtin flow.
+ * Use the builtin flow in the libpq-oauth plugin, which is loaded at runtime.
  */
 
-static int
-use_builtin_flow(PGconn *conn, fe_oauth_state *state, PGoauthBearerRequestV2 *request)
-{
-	return 0;
-}
+typedef char *(*libpq_gettext_func) (const char *msgid);
 
-#elif defined(USE_DYNAMIC_OAUTH)
+#elif defined(USE_LIBCURL)
 
 /*
- * Use the builtin flow in the libpq-oauth plugin, which is loaded at runtime.
+ * For static builds, we can just call pg_start_oauthbearer() directly. It's
+ * provided by libpq-oauth.a.
  */
+extern int	pg_start_oauthbearer(PGconn *conn, PGoauthBearerRequestV2 *request);
 
-typedef char *(*libpq_gettext_func) (const char *msgid);
+#endif
 
-/*
- * Loads the libpq-oauth plugin via dlopen(), initializes it, and plugs its
- * callbacks into the connection's async auth handlers.
- *
- * Failure to load here results in a relatively quiet connection error, to
- * handle the use case where the build supports loading a flow but a user does
- * not want to install it. Troubleshooting of linker/loader failures can be done
- * via PGOAUTHDEBUG.
- *
- * The lifetime of *request ends shortly after this call, so it must be copied
- * to longer-lived storage.
- */
 static int
 use_builtin_flow(PGconn *conn, fe_oauth_state *state, PGoauthBearerRequestV2 *request)
 {
+#if !defined(USE_LIBCURL)
+	return 0;
+#elif defined(USE_DYNAMIC_OAUTH)
+	/*
+	 * Load the libpq-oauth plugin via dlopen(), initialize it, and plug its
+	 * callbacks into the connection's async auth handlers.
+	 *
+	 * Failure to load here results in a relatively quiet connection error, to
+	 * handle the use case where the build supports loading a flow but a user
+	 * does not want to install it. Troubleshooting of linker/loader failures
+	 * can be done via PGOAUTHDEBUG.
+	 *
+	 * The lifetime of *request ends shortly after this call, so it must be
+	 * copied to longer-lived storage.
+	 */
 	static bool initialized = false;
 	static pthread_mutex_t init_mutex = PTHREAD_MUTEX_INITIALIZER;
 	int			lockerr;
@@ -976,24 +977,10 @@ use_builtin_flow(PGconn *conn, fe_oauth_state *state, PGoauthBearerRequestV2 *re
 	}
 
 	return (start_flow(conn, request) == 0) ? 1 : -1;
-}
-
 #else
-
-/*
- * For static builds, we can just call pg_start_oauthbearer() directly. It's
- * provided by libpq-oauth.a.
- */
-
-extern int	pg_start_oauthbearer(PGconn *conn, PGoauthBearerRequestV2 *request);
-
-static int
-use_builtin_flow(PGconn *conn, fe_oauth_state *state, PGoauthBearerRequestV2 *request)
-{
 	return (pg_start_oauthbearer(conn, request) == 0) ? 1 : -1;
-}
-
 #endif							/* USE_LIBCURL */
+}
 
 
 /*
-- 
2.53.0


--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
 filename=v1-0002-Collapse-SH_CREATE-into-a-single-definition.patch



^ permalink  raw  reply  [nested|flat] 57+ messages in thread

* [PATCH v1 1/2] libpq-oauth: collapse use_builtin_flow() into a single definition
@ 2026-07-01 10:31 Jonathan Gonzalez V. <[email protected]>
  0 siblings, 0 replies; 57+ messages in thread

From: Jonathan Gonzalez V. @ 2026-07-01 10:31 UTC (permalink / raw)

There was three separated definition of the function making lcov v2.x fail
with an error.
---
 src/interfaces/libpq/fe-auth-oauth.c | 61 +++++++++++-----------------
 1 file changed, 24 insertions(+), 37 deletions(-)

diff --git a/src/interfaces/libpq/fe-auth-oauth.c b/src/interfaces/libpq/fe-auth-oauth.c
index 826f7461cb3..7a35647feb8 100644
--- a/src/interfaces/libpq/fe-auth-oauth.c
+++ b/src/interfaces/libpq/fe-auth-oauth.c
@@ -833,41 +833,42 @@ cleanup_oauth_flow(PGconn *conn)
  * failure, and positive indicates success.
  */
 
-#if !defined(USE_LIBCURL)
+#if defined(USE_LIBCURL) && defined(USE_DYNAMIC_OAUTH)
 
 /*
- * This configuration doesn't support the builtin flow.
+ * Use the builtin flow in the libpq-oauth plugin, which is loaded at runtime.
  */
 
-static int
-use_builtin_flow(PGconn *conn, fe_oauth_state *state, PGoauthBearerRequestV2 *request)
-{
-	return 0;
-}
+typedef char *(*libpq_gettext_func) (const char *msgid);
 
-#elif defined(USE_DYNAMIC_OAUTH)
+#elif defined(USE_LIBCURL)
 
 /*
- * Use the builtin flow in the libpq-oauth plugin, which is loaded at runtime.
+ * For static builds, we can just call pg_start_oauthbearer() directly. It's
+ * provided by libpq-oauth.a.
  */
+extern int	pg_start_oauthbearer(PGconn *conn, PGoauthBearerRequestV2 *request);
 
-typedef char *(*libpq_gettext_func) (const char *msgid);
+#endif
 
-/*
- * Loads the libpq-oauth plugin via dlopen(), initializes it, and plugs its
- * callbacks into the connection's async auth handlers.
- *
- * Failure to load here results in a relatively quiet connection error, to
- * handle the use case where the build supports loading a flow but a user does
- * not want to install it. Troubleshooting of linker/loader failures can be done
- * via PGOAUTHDEBUG.
- *
- * The lifetime of *request ends shortly after this call, so it must be copied
- * to longer-lived storage.
- */
 static int
 use_builtin_flow(PGconn *conn, fe_oauth_state *state, PGoauthBearerRequestV2 *request)
 {
+#if !defined(USE_LIBCURL)
+	return 0;
+#elif defined(USE_DYNAMIC_OAUTH)
+	/*
+	 * Load the libpq-oauth plugin via dlopen(), initialize it, and plug its
+	 * callbacks into the connection's async auth handlers.
+	 *
+	 * Failure to load here results in a relatively quiet connection error, to
+	 * handle the use case where the build supports loading a flow but a user
+	 * does not want to install it. Troubleshooting of linker/loader failures
+	 * can be done via PGOAUTHDEBUG.
+	 *
+	 * The lifetime of *request ends shortly after this call, so it must be
+	 * copied to longer-lived storage.
+	 */
 	static bool initialized = false;
 	static pthread_mutex_t init_mutex = PTHREAD_MUTEX_INITIALIZER;
 	int			lockerr;
@@ -976,24 +977,10 @@ use_builtin_flow(PGconn *conn, fe_oauth_state *state, PGoauthBearerRequestV2 *re
 	}
 
 	return (start_flow(conn, request) == 0) ? 1 : -1;
-}
-
 #else
-
-/*
- * For static builds, we can just call pg_start_oauthbearer() directly. It's
- * provided by libpq-oauth.a.
- */
-
-extern int	pg_start_oauthbearer(PGconn *conn, PGoauthBearerRequestV2 *request);
-
-static int
-use_builtin_flow(PGconn *conn, fe_oauth_state *state, PGoauthBearerRequestV2 *request)
-{
 	return (pg_start_oauthbearer(conn, request) == 0) ? 1 : -1;
-}
-
 #endif							/* USE_LIBCURL */
+}
 
 
 /*
-- 
2.53.0


--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
 filename=v1-0002-Collapse-SH_CREATE-into-a-single-definition.patch



^ permalink  raw  reply  [nested|flat] 57+ messages in thread

* [PATCH v1 1/2] libpq-oauth: collapse use_builtin_flow() into a single definition
@ 2026-07-01 10:31 Jonathan Gonzalez V. <[email protected]>
  0 siblings, 0 replies; 57+ messages in thread

From: Jonathan Gonzalez V. @ 2026-07-01 10:31 UTC (permalink / raw)

There was three separated definition of the function making lcov v2.x fail
with an error.
---
 src/interfaces/libpq/fe-auth-oauth.c | 61 +++++++++++-----------------
 1 file changed, 24 insertions(+), 37 deletions(-)

diff --git a/src/interfaces/libpq/fe-auth-oauth.c b/src/interfaces/libpq/fe-auth-oauth.c
index 826f7461cb3..7a35647feb8 100644
--- a/src/interfaces/libpq/fe-auth-oauth.c
+++ b/src/interfaces/libpq/fe-auth-oauth.c
@@ -833,41 +833,42 @@ cleanup_oauth_flow(PGconn *conn)
  * failure, and positive indicates success.
  */
 
-#if !defined(USE_LIBCURL)
+#if defined(USE_LIBCURL) && defined(USE_DYNAMIC_OAUTH)
 
 /*
- * This configuration doesn't support the builtin flow.
+ * Use the builtin flow in the libpq-oauth plugin, which is loaded at runtime.
  */
 
-static int
-use_builtin_flow(PGconn *conn, fe_oauth_state *state, PGoauthBearerRequestV2 *request)
-{
-	return 0;
-}
+typedef char *(*libpq_gettext_func) (const char *msgid);
 
-#elif defined(USE_DYNAMIC_OAUTH)
+#elif defined(USE_LIBCURL)
 
 /*
- * Use the builtin flow in the libpq-oauth plugin, which is loaded at runtime.
+ * For static builds, we can just call pg_start_oauthbearer() directly. It's
+ * provided by libpq-oauth.a.
  */
+extern int	pg_start_oauthbearer(PGconn *conn, PGoauthBearerRequestV2 *request);
 
-typedef char *(*libpq_gettext_func) (const char *msgid);
+#endif
 
-/*
- * Loads the libpq-oauth plugin via dlopen(), initializes it, and plugs its
- * callbacks into the connection's async auth handlers.
- *
- * Failure to load here results in a relatively quiet connection error, to
- * handle the use case where the build supports loading a flow but a user does
- * not want to install it. Troubleshooting of linker/loader failures can be done
- * via PGOAUTHDEBUG.
- *
- * The lifetime of *request ends shortly after this call, so it must be copied
- * to longer-lived storage.
- */
 static int
 use_builtin_flow(PGconn *conn, fe_oauth_state *state, PGoauthBearerRequestV2 *request)
 {
+#if !defined(USE_LIBCURL)
+	return 0;
+#elif defined(USE_DYNAMIC_OAUTH)
+	/*
+	 * Load the libpq-oauth plugin via dlopen(), initialize it, and plug its
+	 * callbacks into the connection's async auth handlers.
+	 *
+	 * Failure to load here results in a relatively quiet connection error, to
+	 * handle the use case where the build supports loading a flow but a user
+	 * does not want to install it. Troubleshooting of linker/loader failures
+	 * can be done via PGOAUTHDEBUG.
+	 *
+	 * The lifetime of *request ends shortly after this call, so it must be
+	 * copied to longer-lived storage.
+	 */
 	static bool initialized = false;
 	static pthread_mutex_t init_mutex = PTHREAD_MUTEX_INITIALIZER;
 	int			lockerr;
@@ -976,24 +977,10 @@ use_builtin_flow(PGconn *conn, fe_oauth_state *state, PGoauthBearerRequestV2 *re
 	}
 
 	return (start_flow(conn, request) == 0) ? 1 : -1;
-}
-
 #else
-
-/*
- * For static builds, we can just call pg_start_oauthbearer() directly. It's
- * provided by libpq-oauth.a.
- */
-
-extern int	pg_start_oauthbearer(PGconn *conn, PGoauthBearerRequestV2 *request);
-
-static int
-use_builtin_flow(PGconn *conn, fe_oauth_state *state, PGoauthBearerRequestV2 *request)
-{
 	return (pg_start_oauthbearer(conn, request) == 0) ? 1 : -1;
-}
-
 #endif							/* USE_LIBCURL */
+}
 
 
 /*
-- 
2.53.0


--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
 filename=v1-0002-Collapse-SH_CREATE-into-a-single-definition.patch



^ permalink  raw  reply  [nested|flat] 57+ messages in thread

* [PATCH v1 1/2] libpq-oauth: collapse use_builtin_flow() into a single definition
@ 2026-07-01 10:31 Jonathan Gonzalez V. <[email protected]>
  0 siblings, 0 replies; 57+ messages in thread

From: Jonathan Gonzalez V. @ 2026-07-01 10:31 UTC (permalink / raw)

There was three separated definition of the function making lcov v2.x fail
with an error.
---
 src/interfaces/libpq/fe-auth-oauth.c | 61 +++++++++++-----------------
 1 file changed, 24 insertions(+), 37 deletions(-)

diff --git a/src/interfaces/libpq/fe-auth-oauth.c b/src/interfaces/libpq/fe-auth-oauth.c
index 826f7461cb3..7a35647feb8 100644
--- a/src/interfaces/libpq/fe-auth-oauth.c
+++ b/src/interfaces/libpq/fe-auth-oauth.c
@@ -833,41 +833,42 @@ cleanup_oauth_flow(PGconn *conn)
  * failure, and positive indicates success.
  */
 
-#if !defined(USE_LIBCURL)
+#if defined(USE_LIBCURL) && defined(USE_DYNAMIC_OAUTH)
 
 /*
- * This configuration doesn't support the builtin flow.
+ * Use the builtin flow in the libpq-oauth plugin, which is loaded at runtime.
  */
 
-static int
-use_builtin_flow(PGconn *conn, fe_oauth_state *state, PGoauthBearerRequestV2 *request)
-{
-	return 0;
-}
+typedef char *(*libpq_gettext_func) (const char *msgid);
 
-#elif defined(USE_DYNAMIC_OAUTH)
+#elif defined(USE_LIBCURL)
 
 /*
- * Use the builtin flow in the libpq-oauth plugin, which is loaded at runtime.
+ * For static builds, we can just call pg_start_oauthbearer() directly. It's
+ * provided by libpq-oauth.a.
  */
+extern int	pg_start_oauthbearer(PGconn *conn, PGoauthBearerRequestV2 *request);
 
-typedef char *(*libpq_gettext_func) (const char *msgid);
+#endif
 
-/*
- * Loads the libpq-oauth plugin via dlopen(), initializes it, and plugs its
- * callbacks into the connection's async auth handlers.
- *
- * Failure to load here results in a relatively quiet connection error, to
- * handle the use case where the build supports loading a flow but a user does
- * not want to install it. Troubleshooting of linker/loader failures can be done
- * via PGOAUTHDEBUG.
- *
- * The lifetime of *request ends shortly after this call, so it must be copied
- * to longer-lived storage.
- */
 static int
 use_builtin_flow(PGconn *conn, fe_oauth_state *state, PGoauthBearerRequestV2 *request)
 {
+#if !defined(USE_LIBCURL)
+	return 0;
+#elif defined(USE_DYNAMIC_OAUTH)
+	/*
+	 * Load the libpq-oauth plugin via dlopen(), initialize it, and plug its
+	 * callbacks into the connection's async auth handlers.
+	 *
+	 * Failure to load here results in a relatively quiet connection error, to
+	 * handle the use case where the build supports loading a flow but a user
+	 * does not want to install it. Troubleshooting of linker/loader failures
+	 * can be done via PGOAUTHDEBUG.
+	 *
+	 * The lifetime of *request ends shortly after this call, so it must be
+	 * copied to longer-lived storage.
+	 */
 	static bool initialized = false;
 	static pthread_mutex_t init_mutex = PTHREAD_MUTEX_INITIALIZER;
 	int			lockerr;
@@ -976,24 +977,10 @@ use_builtin_flow(PGconn *conn, fe_oauth_state *state, PGoauthBearerRequestV2 *re
 	}
 
 	return (start_flow(conn, request) == 0) ? 1 : -1;
-}
-
 #else
-
-/*
- * For static builds, we can just call pg_start_oauthbearer() directly. It's
- * provided by libpq-oauth.a.
- */
-
-extern int	pg_start_oauthbearer(PGconn *conn, PGoauthBearerRequestV2 *request);
-
-static int
-use_builtin_flow(PGconn *conn, fe_oauth_state *state, PGoauthBearerRequestV2 *request)
-{
 	return (pg_start_oauthbearer(conn, request) == 0) ? 1 : -1;
-}
-
 #endif							/* USE_LIBCURL */
+}
 
 
 /*
-- 
2.53.0


--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
 filename=v1-0002-Collapse-SH_CREATE-into-a-single-definition.patch



^ permalink  raw  reply  [nested|flat] 57+ messages in thread

* [PATCH v1 1/2] libpq-oauth: collapse use_builtin_flow() into a single definition
@ 2026-07-01 10:31 Jonathan Gonzalez V. <[email protected]>
  0 siblings, 0 replies; 57+ messages in thread

From: Jonathan Gonzalez V. @ 2026-07-01 10:31 UTC (permalink / raw)

There was three separated definition of the function making lcov v2.x fail
with an error.
---
 src/interfaces/libpq/fe-auth-oauth.c | 61 +++++++++++-----------------
 1 file changed, 24 insertions(+), 37 deletions(-)

diff --git a/src/interfaces/libpq/fe-auth-oauth.c b/src/interfaces/libpq/fe-auth-oauth.c
index 826f7461cb3..7a35647feb8 100644
--- a/src/interfaces/libpq/fe-auth-oauth.c
+++ b/src/interfaces/libpq/fe-auth-oauth.c
@@ -833,41 +833,42 @@ cleanup_oauth_flow(PGconn *conn)
  * failure, and positive indicates success.
  */
 
-#if !defined(USE_LIBCURL)
+#if defined(USE_LIBCURL) && defined(USE_DYNAMIC_OAUTH)
 
 /*
- * This configuration doesn't support the builtin flow.
+ * Use the builtin flow in the libpq-oauth plugin, which is loaded at runtime.
  */
 
-static int
-use_builtin_flow(PGconn *conn, fe_oauth_state *state, PGoauthBearerRequestV2 *request)
-{
-	return 0;
-}
+typedef char *(*libpq_gettext_func) (const char *msgid);
 
-#elif defined(USE_DYNAMIC_OAUTH)
+#elif defined(USE_LIBCURL)
 
 /*
- * Use the builtin flow in the libpq-oauth plugin, which is loaded at runtime.
+ * For static builds, we can just call pg_start_oauthbearer() directly. It's
+ * provided by libpq-oauth.a.
  */
+extern int	pg_start_oauthbearer(PGconn *conn, PGoauthBearerRequestV2 *request);
 
-typedef char *(*libpq_gettext_func) (const char *msgid);
+#endif
 
-/*
- * Loads the libpq-oauth plugin via dlopen(), initializes it, and plugs its
- * callbacks into the connection's async auth handlers.
- *
- * Failure to load here results in a relatively quiet connection error, to
- * handle the use case where the build supports loading a flow but a user does
- * not want to install it. Troubleshooting of linker/loader failures can be done
- * via PGOAUTHDEBUG.
- *
- * The lifetime of *request ends shortly after this call, so it must be copied
- * to longer-lived storage.
- */
 static int
 use_builtin_flow(PGconn *conn, fe_oauth_state *state, PGoauthBearerRequestV2 *request)
 {
+#if !defined(USE_LIBCURL)
+	return 0;
+#elif defined(USE_DYNAMIC_OAUTH)
+	/*
+	 * Load the libpq-oauth plugin via dlopen(), initialize it, and plug its
+	 * callbacks into the connection's async auth handlers.
+	 *
+	 * Failure to load here results in a relatively quiet connection error, to
+	 * handle the use case where the build supports loading a flow but a user
+	 * does not want to install it. Troubleshooting of linker/loader failures
+	 * can be done via PGOAUTHDEBUG.
+	 *
+	 * The lifetime of *request ends shortly after this call, so it must be
+	 * copied to longer-lived storage.
+	 */
 	static bool initialized = false;
 	static pthread_mutex_t init_mutex = PTHREAD_MUTEX_INITIALIZER;
 	int			lockerr;
@@ -976,24 +977,10 @@ use_builtin_flow(PGconn *conn, fe_oauth_state *state, PGoauthBearerRequestV2 *re
 	}
 
 	return (start_flow(conn, request) == 0) ? 1 : -1;
-}
-
 #else
-
-/*
- * For static builds, we can just call pg_start_oauthbearer() directly. It's
- * provided by libpq-oauth.a.
- */
-
-extern int	pg_start_oauthbearer(PGconn *conn, PGoauthBearerRequestV2 *request);
-
-static int
-use_builtin_flow(PGconn *conn, fe_oauth_state *state, PGoauthBearerRequestV2 *request)
-{
 	return (pg_start_oauthbearer(conn, request) == 0) ? 1 : -1;
-}
-
 #endif							/* USE_LIBCURL */
+}
 
 
 /*
-- 
2.53.0


--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
 filename=v1-0002-Collapse-SH_CREATE-into-a-single-definition.patch



^ permalink  raw  reply  [nested|flat] 57+ messages in thread

* [PATCH v1 1/2] libpq-oauth: collapse use_builtin_flow() into a single definition
@ 2026-07-01 10:31 Jonathan Gonzalez V. <[email protected]>
  0 siblings, 0 replies; 57+ messages in thread

From: Jonathan Gonzalez V. @ 2026-07-01 10:31 UTC (permalink / raw)

There was three separated definition of the function making lcov v2.x fail
with an error.
---
 src/interfaces/libpq/fe-auth-oauth.c | 61 +++++++++++-----------------
 1 file changed, 24 insertions(+), 37 deletions(-)

diff --git a/src/interfaces/libpq/fe-auth-oauth.c b/src/interfaces/libpq/fe-auth-oauth.c
index 826f7461cb3..7a35647feb8 100644
--- a/src/interfaces/libpq/fe-auth-oauth.c
+++ b/src/interfaces/libpq/fe-auth-oauth.c
@@ -833,41 +833,42 @@ cleanup_oauth_flow(PGconn *conn)
  * failure, and positive indicates success.
  */
 
-#if !defined(USE_LIBCURL)
+#if defined(USE_LIBCURL) && defined(USE_DYNAMIC_OAUTH)
 
 /*
- * This configuration doesn't support the builtin flow.
+ * Use the builtin flow in the libpq-oauth plugin, which is loaded at runtime.
  */
 
-static int
-use_builtin_flow(PGconn *conn, fe_oauth_state *state, PGoauthBearerRequestV2 *request)
-{
-	return 0;
-}
+typedef char *(*libpq_gettext_func) (const char *msgid);
 
-#elif defined(USE_DYNAMIC_OAUTH)
+#elif defined(USE_LIBCURL)
 
 /*
- * Use the builtin flow in the libpq-oauth plugin, which is loaded at runtime.
+ * For static builds, we can just call pg_start_oauthbearer() directly. It's
+ * provided by libpq-oauth.a.
  */
+extern int	pg_start_oauthbearer(PGconn *conn, PGoauthBearerRequestV2 *request);
 
-typedef char *(*libpq_gettext_func) (const char *msgid);
+#endif
 
-/*
- * Loads the libpq-oauth plugin via dlopen(), initializes it, and plugs its
- * callbacks into the connection's async auth handlers.
- *
- * Failure to load here results in a relatively quiet connection error, to
- * handle the use case where the build supports loading a flow but a user does
- * not want to install it. Troubleshooting of linker/loader failures can be done
- * via PGOAUTHDEBUG.
- *
- * The lifetime of *request ends shortly after this call, so it must be copied
- * to longer-lived storage.
- */
 static int
 use_builtin_flow(PGconn *conn, fe_oauth_state *state, PGoauthBearerRequestV2 *request)
 {
+#if !defined(USE_LIBCURL)
+	return 0;
+#elif defined(USE_DYNAMIC_OAUTH)
+	/*
+	 * Load the libpq-oauth plugin via dlopen(), initialize it, and plug its
+	 * callbacks into the connection's async auth handlers.
+	 *
+	 * Failure to load here results in a relatively quiet connection error, to
+	 * handle the use case where the build supports loading a flow but a user
+	 * does not want to install it. Troubleshooting of linker/loader failures
+	 * can be done via PGOAUTHDEBUG.
+	 *
+	 * The lifetime of *request ends shortly after this call, so it must be
+	 * copied to longer-lived storage.
+	 */
 	static bool initialized = false;
 	static pthread_mutex_t init_mutex = PTHREAD_MUTEX_INITIALIZER;
 	int			lockerr;
@@ -976,24 +977,10 @@ use_builtin_flow(PGconn *conn, fe_oauth_state *state, PGoauthBearerRequestV2 *re
 	}
 
 	return (start_flow(conn, request) == 0) ? 1 : -1;
-}
-
 #else
-
-/*
- * For static builds, we can just call pg_start_oauthbearer() directly. It's
- * provided by libpq-oauth.a.
- */
-
-extern int	pg_start_oauthbearer(PGconn *conn, PGoauthBearerRequestV2 *request);
-
-static int
-use_builtin_flow(PGconn *conn, fe_oauth_state *state, PGoauthBearerRequestV2 *request)
-{
 	return (pg_start_oauthbearer(conn, request) == 0) ? 1 : -1;
-}
-
 #endif							/* USE_LIBCURL */
+}
 
 
 /*
-- 
2.53.0


--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
 filename=v1-0002-Collapse-SH_CREATE-into-a-single-definition.patch



^ permalink  raw  reply  [nested|flat] 57+ messages in thread

* [PATCH v1 1/2] libpq-oauth: collapse use_builtin_flow() into a single definition
@ 2026-07-01 10:31 Jonathan Gonzalez V. <[email protected]>
  0 siblings, 0 replies; 57+ messages in thread

From: Jonathan Gonzalez V. @ 2026-07-01 10:31 UTC (permalink / raw)

There was three separated definition of the function making lcov v2.x fail
with an error.
---
 src/interfaces/libpq/fe-auth-oauth.c | 61 +++++++++++-----------------
 1 file changed, 24 insertions(+), 37 deletions(-)

diff --git a/src/interfaces/libpq/fe-auth-oauth.c b/src/interfaces/libpq/fe-auth-oauth.c
index 826f7461cb3..7a35647feb8 100644
--- a/src/interfaces/libpq/fe-auth-oauth.c
+++ b/src/interfaces/libpq/fe-auth-oauth.c
@@ -833,41 +833,42 @@ cleanup_oauth_flow(PGconn *conn)
  * failure, and positive indicates success.
  */
 
-#if !defined(USE_LIBCURL)
+#if defined(USE_LIBCURL) && defined(USE_DYNAMIC_OAUTH)
 
 /*
- * This configuration doesn't support the builtin flow.
+ * Use the builtin flow in the libpq-oauth plugin, which is loaded at runtime.
  */
 
-static int
-use_builtin_flow(PGconn *conn, fe_oauth_state *state, PGoauthBearerRequestV2 *request)
-{
-	return 0;
-}
+typedef char *(*libpq_gettext_func) (const char *msgid);
 
-#elif defined(USE_DYNAMIC_OAUTH)
+#elif defined(USE_LIBCURL)
 
 /*
- * Use the builtin flow in the libpq-oauth plugin, which is loaded at runtime.
+ * For static builds, we can just call pg_start_oauthbearer() directly. It's
+ * provided by libpq-oauth.a.
  */
+extern int	pg_start_oauthbearer(PGconn *conn, PGoauthBearerRequestV2 *request);
 
-typedef char *(*libpq_gettext_func) (const char *msgid);
+#endif
 
-/*
- * Loads the libpq-oauth plugin via dlopen(), initializes it, and plugs its
- * callbacks into the connection's async auth handlers.
- *
- * Failure to load here results in a relatively quiet connection error, to
- * handle the use case where the build supports loading a flow but a user does
- * not want to install it. Troubleshooting of linker/loader failures can be done
- * via PGOAUTHDEBUG.
- *
- * The lifetime of *request ends shortly after this call, so it must be copied
- * to longer-lived storage.
- */
 static int
 use_builtin_flow(PGconn *conn, fe_oauth_state *state, PGoauthBearerRequestV2 *request)
 {
+#if !defined(USE_LIBCURL)
+	return 0;
+#elif defined(USE_DYNAMIC_OAUTH)
+	/*
+	 * Load the libpq-oauth plugin via dlopen(), initialize it, and plug its
+	 * callbacks into the connection's async auth handlers.
+	 *
+	 * Failure to load here results in a relatively quiet connection error, to
+	 * handle the use case where the build supports loading a flow but a user
+	 * does not want to install it. Troubleshooting of linker/loader failures
+	 * can be done via PGOAUTHDEBUG.
+	 *
+	 * The lifetime of *request ends shortly after this call, so it must be
+	 * copied to longer-lived storage.
+	 */
 	static bool initialized = false;
 	static pthread_mutex_t init_mutex = PTHREAD_MUTEX_INITIALIZER;
 	int			lockerr;
@@ -976,24 +977,10 @@ use_builtin_flow(PGconn *conn, fe_oauth_state *state, PGoauthBearerRequestV2 *re
 	}
 
 	return (start_flow(conn, request) == 0) ? 1 : -1;
-}
-
 #else
-
-/*
- * For static builds, we can just call pg_start_oauthbearer() directly. It's
- * provided by libpq-oauth.a.
- */
-
-extern int	pg_start_oauthbearer(PGconn *conn, PGoauthBearerRequestV2 *request);
-
-static int
-use_builtin_flow(PGconn *conn, fe_oauth_state *state, PGoauthBearerRequestV2 *request)
-{
 	return (pg_start_oauthbearer(conn, request) == 0) ? 1 : -1;
-}
-
 #endif							/* USE_LIBCURL */
+}
 
 
 /*
-- 
2.53.0


--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
 filename=v1-0002-Collapse-SH_CREATE-into-a-single-definition.patch



^ permalink  raw  reply  [nested|flat] 57+ messages in thread

* [PATCH v1 1/2] libpq-oauth: collapse use_builtin_flow() into a single definition
@ 2026-07-01 10:31 Jonathan Gonzalez V. <[email protected]>
  0 siblings, 0 replies; 57+ messages in thread

From: Jonathan Gonzalez V. @ 2026-07-01 10:31 UTC (permalink / raw)

There was three separated definition of the function making lcov v2.x fail
with an error.
---
 src/interfaces/libpq/fe-auth-oauth.c | 61 +++++++++++-----------------
 1 file changed, 24 insertions(+), 37 deletions(-)

diff --git a/src/interfaces/libpq/fe-auth-oauth.c b/src/interfaces/libpq/fe-auth-oauth.c
index 826f7461cb3..7a35647feb8 100644
--- a/src/interfaces/libpq/fe-auth-oauth.c
+++ b/src/interfaces/libpq/fe-auth-oauth.c
@@ -833,41 +833,42 @@ cleanup_oauth_flow(PGconn *conn)
  * failure, and positive indicates success.
  */
 
-#if !defined(USE_LIBCURL)
+#if defined(USE_LIBCURL) && defined(USE_DYNAMIC_OAUTH)
 
 /*
- * This configuration doesn't support the builtin flow.
+ * Use the builtin flow in the libpq-oauth plugin, which is loaded at runtime.
  */
 
-static int
-use_builtin_flow(PGconn *conn, fe_oauth_state *state, PGoauthBearerRequestV2 *request)
-{
-	return 0;
-}
+typedef char *(*libpq_gettext_func) (const char *msgid);
 
-#elif defined(USE_DYNAMIC_OAUTH)
+#elif defined(USE_LIBCURL)
 
 /*
- * Use the builtin flow in the libpq-oauth plugin, which is loaded at runtime.
+ * For static builds, we can just call pg_start_oauthbearer() directly. It's
+ * provided by libpq-oauth.a.
  */
+extern int	pg_start_oauthbearer(PGconn *conn, PGoauthBearerRequestV2 *request);
 
-typedef char *(*libpq_gettext_func) (const char *msgid);
+#endif
 
-/*
- * Loads the libpq-oauth plugin via dlopen(), initializes it, and plugs its
- * callbacks into the connection's async auth handlers.
- *
- * Failure to load here results in a relatively quiet connection error, to
- * handle the use case where the build supports loading a flow but a user does
- * not want to install it. Troubleshooting of linker/loader failures can be done
- * via PGOAUTHDEBUG.
- *
- * The lifetime of *request ends shortly after this call, so it must be copied
- * to longer-lived storage.
- */
 static int
 use_builtin_flow(PGconn *conn, fe_oauth_state *state, PGoauthBearerRequestV2 *request)
 {
+#if !defined(USE_LIBCURL)
+	return 0;
+#elif defined(USE_DYNAMIC_OAUTH)
+	/*
+	 * Load the libpq-oauth plugin via dlopen(), initialize it, and plug its
+	 * callbacks into the connection's async auth handlers.
+	 *
+	 * Failure to load here results in a relatively quiet connection error, to
+	 * handle the use case where the build supports loading a flow but a user
+	 * does not want to install it. Troubleshooting of linker/loader failures
+	 * can be done via PGOAUTHDEBUG.
+	 *
+	 * The lifetime of *request ends shortly after this call, so it must be
+	 * copied to longer-lived storage.
+	 */
 	static bool initialized = false;
 	static pthread_mutex_t init_mutex = PTHREAD_MUTEX_INITIALIZER;
 	int			lockerr;
@@ -976,24 +977,10 @@ use_builtin_flow(PGconn *conn, fe_oauth_state *state, PGoauthBearerRequestV2 *re
 	}
 
 	return (start_flow(conn, request) == 0) ? 1 : -1;
-}
-
 #else
-
-/*
- * For static builds, we can just call pg_start_oauthbearer() directly. It's
- * provided by libpq-oauth.a.
- */
-
-extern int	pg_start_oauthbearer(PGconn *conn, PGoauthBearerRequestV2 *request);
-
-static int
-use_builtin_flow(PGconn *conn, fe_oauth_state *state, PGoauthBearerRequestV2 *request)
-{
 	return (pg_start_oauthbearer(conn, request) == 0) ? 1 : -1;
-}
-
 #endif							/* USE_LIBCURL */
+}
 
 
 /*
-- 
2.53.0


--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
 filename=v1-0002-Collapse-SH_CREATE-into-a-single-definition.patch



^ permalink  raw  reply  [nested|flat] 57+ messages in thread

* [PATCH v1 1/2] libpq-oauth: collapse use_builtin_flow() into a single definition
@ 2026-07-01 10:31 Jonathan Gonzalez V. <[email protected]>
  0 siblings, 0 replies; 57+ messages in thread

From: Jonathan Gonzalez V. @ 2026-07-01 10:31 UTC (permalink / raw)

There was three separated definition of the function making lcov v2.x fail
with an error.
---
 src/interfaces/libpq/fe-auth-oauth.c | 61 +++++++++++-----------------
 1 file changed, 24 insertions(+), 37 deletions(-)

diff --git a/src/interfaces/libpq/fe-auth-oauth.c b/src/interfaces/libpq/fe-auth-oauth.c
index 826f7461cb3..7a35647feb8 100644
--- a/src/interfaces/libpq/fe-auth-oauth.c
+++ b/src/interfaces/libpq/fe-auth-oauth.c
@@ -833,41 +833,42 @@ cleanup_oauth_flow(PGconn *conn)
  * failure, and positive indicates success.
  */
 
-#if !defined(USE_LIBCURL)
+#if defined(USE_LIBCURL) && defined(USE_DYNAMIC_OAUTH)
 
 /*
- * This configuration doesn't support the builtin flow.
+ * Use the builtin flow in the libpq-oauth plugin, which is loaded at runtime.
  */
 
-static int
-use_builtin_flow(PGconn *conn, fe_oauth_state *state, PGoauthBearerRequestV2 *request)
-{
-	return 0;
-}
+typedef char *(*libpq_gettext_func) (const char *msgid);
 
-#elif defined(USE_DYNAMIC_OAUTH)
+#elif defined(USE_LIBCURL)
 
 /*
- * Use the builtin flow in the libpq-oauth plugin, which is loaded at runtime.
+ * For static builds, we can just call pg_start_oauthbearer() directly. It's
+ * provided by libpq-oauth.a.
  */
+extern int	pg_start_oauthbearer(PGconn *conn, PGoauthBearerRequestV2 *request);
 
-typedef char *(*libpq_gettext_func) (const char *msgid);
+#endif
 
-/*
- * Loads the libpq-oauth plugin via dlopen(), initializes it, and plugs its
- * callbacks into the connection's async auth handlers.
- *
- * Failure to load here results in a relatively quiet connection error, to
- * handle the use case where the build supports loading a flow but a user does
- * not want to install it. Troubleshooting of linker/loader failures can be done
- * via PGOAUTHDEBUG.
- *
- * The lifetime of *request ends shortly after this call, so it must be copied
- * to longer-lived storage.
- */
 static int
 use_builtin_flow(PGconn *conn, fe_oauth_state *state, PGoauthBearerRequestV2 *request)
 {
+#if !defined(USE_LIBCURL)
+	return 0;
+#elif defined(USE_DYNAMIC_OAUTH)
+	/*
+	 * Load the libpq-oauth plugin via dlopen(), initialize it, and plug its
+	 * callbacks into the connection's async auth handlers.
+	 *
+	 * Failure to load here results in a relatively quiet connection error, to
+	 * handle the use case where the build supports loading a flow but a user
+	 * does not want to install it. Troubleshooting of linker/loader failures
+	 * can be done via PGOAUTHDEBUG.
+	 *
+	 * The lifetime of *request ends shortly after this call, so it must be
+	 * copied to longer-lived storage.
+	 */
 	static bool initialized = false;
 	static pthread_mutex_t init_mutex = PTHREAD_MUTEX_INITIALIZER;
 	int			lockerr;
@@ -976,24 +977,10 @@ use_builtin_flow(PGconn *conn, fe_oauth_state *state, PGoauthBearerRequestV2 *re
 	}
 
 	return (start_flow(conn, request) == 0) ? 1 : -1;
-}
-
 #else
-
-/*
- * For static builds, we can just call pg_start_oauthbearer() directly. It's
- * provided by libpq-oauth.a.
- */
-
-extern int	pg_start_oauthbearer(PGconn *conn, PGoauthBearerRequestV2 *request);
-
-static int
-use_builtin_flow(PGconn *conn, fe_oauth_state *state, PGoauthBearerRequestV2 *request)
-{
 	return (pg_start_oauthbearer(conn, request) == 0) ? 1 : -1;
-}
-
 #endif							/* USE_LIBCURL */
+}
 
 
 /*
-- 
2.53.0


--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
 filename=v1-0002-Collapse-SH_CREATE-into-a-single-definition.patch



^ permalink  raw  reply  [nested|flat] 57+ messages in thread

* [PATCH v1 1/2] libpq-oauth: collapse use_builtin_flow() into a single definition
@ 2026-07-01 10:31 Jonathan Gonzalez V. <[email protected]>
  0 siblings, 0 replies; 57+ messages in thread

From: Jonathan Gonzalez V. @ 2026-07-01 10:31 UTC (permalink / raw)

There was three separated definition of the function making lcov v2.x fail
with an error.
---
 src/interfaces/libpq/fe-auth-oauth.c | 61 +++++++++++-----------------
 1 file changed, 24 insertions(+), 37 deletions(-)

diff --git a/src/interfaces/libpq/fe-auth-oauth.c b/src/interfaces/libpq/fe-auth-oauth.c
index 826f7461cb3..7a35647feb8 100644
--- a/src/interfaces/libpq/fe-auth-oauth.c
+++ b/src/interfaces/libpq/fe-auth-oauth.c
@@ -833,41 +833,42 @@ cleanup_oauth_flow(PGconn *conn)
  * failure, and positive indicates success.
  */
 
-#if !defined(USE_LIBCURL)
+#if defined(USE_LIBCURL) && defined(USE_DYNAMIC_OAUTH)
 
 /*
- * This configuration doesn't support the builtin flow.
+ * Use the builtin flow in the libpq-oauth plugin, which is loaded at runtime.
  */
 
-static int
-use_builtin_flow(PGconn *conn, fe_oauth_state *state, PGoauthBearerRequestV2 *request)
-{
-	return 0;
-}
+typedef char *(*libpq_gettext_func) (const char *msgid);
 
-#elif defined(USE_DYNAMIC_OAUTH)
+#elif defined(USE_LIBCURL)
 
 /*
- * Use the builtin flow in the libpq-oauth plugin, which is loaded at runtime.
+ * For static builds, we can just call pg_start_oauthbearer() directly. It's
+ * provided by libpq-oauth.a.
  */
+extern int	pg_start_oauthbearer(PGconn *conn, PGoauthBearerRequestV2 *request);
 
-typedef char *(*libpq_gettext_func) (const char *msgid);
+#endif
 
-/*
- * Loads the libpq-oauth plugin via dlopen(), initializes it, and plugs its
- * callbacks into the connection's async auth handlers.
- *
- * Failure to load here results in a relatively quiet connection error, to
- * handle the use case where the build supports loading a flow but a user does
- * not want to install it. Troubleshooting of linker/loader failures can be done
- * via PGOAUTHDEBUG.
- *
- * The lifetime of *request ends shortly after this call, so it must be copied
- * to longer-lived storage.
- */
 static int
 use_builtin_flow(PGconn *conn, fe_oauth_state *state, PGoauthBearerRequestV2 *request)
 {
+#if !defined(USE_LIBCURL)
+	return 0;
+#elif defined(USE_DYNAMIC_OAUTH)
+	/*
+	 * Load the libpq-oauth plugin via dlopen(), initialize it, and plug its
+	 * callbacks into the connection's async auth handlers.
+	 *
+	 * Failure to load here results in a relatively quiet connection error, to
+	 * handle the use case where the build supports loading a flow but a user
+	 * does not want to install it. Troubleshooting of linker/loader failures
+	 * can be done via PGOAUTHDEBUG.
+	 *
+	 * The lifetime of *request ends shortly after this call, so it must be
+	 * copied to longer-lived storage.
+	 */
 	static bool initialized = false;
 	static pthread_mutex_t init_mutex = PTHREAD_MUTEX_INITIALIZER;
 	int			lockerr;
@@ -976,24 +977,10 @@ use_builtin_flow(PGconn *conn, fe_oauth_state *state, PGoauthBearerRequestV2 *re
 	}
 
 	return (start_flow(conn, request) == 0) ? 1 : -1;
-}
-
 #else
-
-/*
- * For static builds, we can just call pg_start_oauthbearer() directly. It's
- * provided by libpq-oauth.a.
- */
-
-extern int	pg_start_oauthbearer(PGconn *conn, PGoauthBearerRequestV2 *request);
-
-static int
-use_builtin_flow(PGconn *conn, fe_oauth_state *state, PGoauthBearerRequestV2 *request)
-{
 	return (pg_start_oauthbearer(conn, request) == 0) ? 1 : -1;
-}
-
 #endif							/* USE_LIBCURL */
+}
 
 
 /*
-- 
2.53.0


--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
 filename=v1-0002-Collapse-SH_CREATE-into-a-single-definition.patch



^ permalink  raw  reply  [nested|flat] 57+ messages in thread

* [PATCH v1 1/2] libpq-oauth: collapse use_builtin_flow() into a single definition
@ 2026-07-01 10:31 Jonathan Gonzalez V. <[email protected]>
  0 siblings, 0 replies; 57+ messages in thread

From: Jonathan Gonzalez V. @ 2026-07-01 10:31 UTC (permalink / raw)

There was three separated definition of the function making lcov v2.x fail
with an error.
---
 src/interfaces/libpq/fe-auth-oauth.c | 61 +++++++++++-----------------
 1 file changed, 24 insertions(+), 37 deletions(-)

diff --git a/src/interfaces/libpq/fe-auth-oauth.c b/src/interfaces/libpq/fe-auth-oauth.c
index 826f7461cb3..7a35647feb8 100644
--- a/src/interfaces/libpq/fe-auth-oauth.c
+++ b/src/interfaces/libpq/fe-auth-oauth.c
@@ -833,41 +833,42 @@ cleanup_oauth_flow(PGconn *conn)
  * failure, and positive indicates success.
  */
 
-#if !defined(USE_LIBCURL)
+#if defined(USE_LIBCURL) && defined(USE_DYNAMIC_OAUTH)
 
 /*
- * This configuration doesn't support the builtin flow.
+ * Use the builtin flow in the libpq-oauth plugin, which is loaded at runtime.
  */
 
-static int
-use_builtin_flow(PGconn *conn, fe_oauth_state *state, PGoauthBearerRequestV2 *request)
-{
-	return 0;
-}
+typedef char *(*libpq_gettext_func) (const char *msgid);
 
-#elif defined(USE_DYNAMIC_OAUTH)
+#elif defined(USE_LIBCURL)
 
 /*
- * Use the builtin flow in the libpq-oauth plugin, which is loaded at runtime.
+ * For static builds, we can just call pg_start_oauthbearer() directly. It's
+ * provided by libpq-oauth.a.
  */
+extern int	pg_start_oauthbearer(PGconn *conn, PGoauthBearerRequestV2 *request);
 
-typedef char *(*libpq_gettext_func) (const char *msgid);
+#endif
 
-/*
- * Loads the libpq-oauth plugin via dlopen(), initializes it, and plugs its
- * callbacks into the connection's async auth handlers.
- *
- * Failure to load here results in a relatively quiet connection error, to
- * handle the use case where the build supports loading a flow but a user does
- * not want to install it. Troubleshooting of linker/loader failures can be done
- * via PGOAUTHDEBUG.
- *
- * The lifetime of *request ends shortly after this call, so it must be copied
- * to longer-lived storage.
- */
 static int
 use_builtin_flow(PGconn *conn, fe_oauth_state *state, PGoauthBearerRequestV2 *request)
 {
+#if !defined(USE_LIBCURL)
+	return 0;
+#elif defined(USE_DYNAMIC_OAUTH)
+	/*
+	 * Load the libpq-oauth plugin via dlopen(), initialize it, and plug its
+	 * callbacks into the connection's async auth handlers.
+	 *
+	 * Failure to load here results in a relatively quiet connection error, to
+	 * handle the use case where the build supports loading a flow but a user
+	 * does not want to install it. Troubleshooting of linker/loader failures
+	 * can be done via PGOAUTHDEBUG.
+	 *
+	 * The lifetime of *request ends shortly after this call, so it must be
+	 * copied to longer-lived storage.
+	 */
 	static bool initialized = false;
 	static pthread_mutex_t init_mutex = PTHREAD_MUTEX_INITIALIZER;
 	int			lockerr;
@@ -976,24 +977,10 @@ use_builtin_flow(PGconn *conn, fe_oauth_state *state, PGoauthBearerRequestV2 *re
 	}
 
 	return (start_flow(conn, request) == 0) ? 1 : -1;
-}
-
 #else
-
-/*
- * For static builds, we can just call pg_start_oauthbearer() directly. It's
- * provided by libpq-oauth.a.
- */
-
-extern int	pg_start_oauthbearer(PGconn *conn, PGoauthBearerRequestV2 *request);
-
-static int
-use_builtin_flow(PGconn *conn, fe_oauth_state *state, PGoauthBearerRequestV2 *request)
-{
 	return (pg_start_oauthbearer(conn, request) == 0) ? 1 : -1;
-}
-
 #endif							/* USE_LIBCURL */
+}
 
 
 /*
-- 
2.53.0


--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
 filename=v1-0002-Collapse-SH_CREATE-into-a-single-definition.patch



^ permalink  raw  reply  [nested|flat] 57+ messages in thread

* [PATCH v1 1/2] libpq-oauth: collapse use_builtin_flow() into a single definition
@ 2026-07-01 10:31 Jonathan Gonzalez V. <[email protected]>
  0 siblings, 0 replies; 57+ messages in thread

From: Jonathan Gonzalez V. @ 2026-07-01 10:31 UTC (permalink / raw)

There was three separated definition of the function making lcov v2.x fail
with an error.
---
 src/interfaces/libpq/fe-auth-oauth.c | 61 +++++++++++-----------------
 1 file changed, 24 insertions(+), 37 deletions(-)

diff --git a/src/interfaces/libpq/fe-auth-oauth.c b/src/interfaces/libpq/fe-auth-oauth.c
index 826f7461cb3..7a35647feb8 100644
--- a/src/interfaces/libpq/fe-auth-oauth.c
+++ b/src/interfaces/libpq/fe-auth-oauth.c
@@ -833,41 +833,42 @@ cleanup_oauth_flow(PGconn *conn)
  * failure, and positive indicates success.
  */
 
-#if !defined(USE_LIBCURL)
+#if defined(USE_LIBCURL) && defined(USE_DYNAMIC_OAUTH)
 
 /*
- * This configuration doesn't support the builtin flow.
+ * Use the builtin flow in the libpq-oauth plugin, which is loaded at runtime.
  */
 
-static int
-use_builtin_flow(PGconn *conn, fe_oauth_state *state, PGoauthBearerRequestV2 *request)
-{
-	return 0;
-}
+typedef char *(*libpq_gettext_func) (const char *msgid);
 
-#elif defined(USE_DYNAMIC_OAUTH)
+#elif defined(USE_LIBCURL)
 
 /*
- * Use the builtin flow in the libpq-oauth plugin, which is loaded at runtime.
+ * For static builds, we can just call pg_start_oauthbearer() directly. It's
+ * provided by libpq-oauth.a.
  */
+extern int	pg_start_oauthbearer(PGconn *conn, PGoauthBearerRequestV2 *request);
 
-typedef char *(*libpq_gettext_func) (const char *msgid);
+#endif
 
-/*
- * Loads the libpq-oauth plugin via dlopen(), initializes it, and plugs its
- * callbacks into the connection's async auth handlers.
- *
- * Failure to load here results in a relatively quiet connection error, to
- * handle the use case where the build supports loading a flow but a user does
- * not want to install it. Troubleshooting of linker/loader failures can be done
- * via PGOAUTHDEBUG.
- *
- * The lifetime of *request ends shortly after this call, so it must be copied
- * to longer-lived storage.
- */
 static int
 use_builtin_flow(PGconn *conn, fe_oauth_state *state, PGoauthBearerRequestV2 *request)
 {
+#if !defined(USE_LIBCURL)
+	return 0;
+#elif defined(USE_DYNAMIC_OAUTH)
+	/*
+	 * Load the libpq-oauth plugin via dlopen(), initialize it, and plug its
+	 * callbacks into the connection's async auth handlers.
+	 *
+	 * Failure to load here results in a relatively quiet connection error, to
+	 * handle the use case where the build supports loading a flow but a user
+	 * does not want to install it. Troubleshooting of linker/loader failures
+	 * can be done via PGOAUTHDEBUG.
+	 *
+	 * The lifetime of *request ends shortly after this call, so it must be
+	 * copied to longer-lived storage.
+	 */
 	static bool initialized = false;
 	static pthread_mutex_t init_mutex = PTHREAD_MUTEX_INITIALIZER;
 	int			lockerr;
@@ -976,24 +977,10 @@ use_builtin_flow(PGconn *conn, fe_oauth_state *state, PGoauthBearerRequestV2 *re
 	}
 
 	return (start_flow(conn, request) == 0) ? 1 : -1;
-}
-
 #else
-
-/*
- * For static builds, we can just call pg_start_oauthbearer() directly. It's
- * provided by libpq-oauth.a.
- */
-
-extern int	pg_start_oauthbearer(PGconn *conn, PGoauthBearerRequestV2 *request);
-
-static int
-use_builtin_flow(PGconn *conn, fe_oauth_state *state, PGoauthBearerRequestV2 *request)
-{
 	return (pg_start_oauthbearer(conn, request) == 0) ? 1 : -1;
-}
-
 #endif							/* USE_LIBCURL */
+}
 
 
 /*
-- 
2.53.0


--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
 filename=v1-0002-Collapse-SH_CREATE-into-a-single-definition.patch



^ permalink  raw  reply  [nested|flat] 57+ messages in thread

* [PATCH v1 1/2] libpq-oauth: collapse use_builtin_flow() into a single definition
@ 2026-07-01 10:31 Jonathan Gonzalez V. <[email protected]>
  0 siblings, 0 replies; 57+ messages in thread

From: Jonathan Gonzalez V. @ 2026-07-01 10:31 UTC (permalink / raw)

There was three separated definition of the function making lcov v2.x fail
with an error.
---
 src/interfaces/libpq/fe-auth-oauth.c | 61 +++++++++++-----------------
 1 file changed, 24 insertions(+), 37 deletions(-)

diff --git a/src/interfaces/libpq/fe-auth-oauth.c b/src/interfaces/libpq/fe-auth-oauth.c
index 826f7461cb3..7a35647feb8 100644
--- a/src/interfaces/libpq/fe-auth-oauth.c
+++ b/src/interfaces/libpq/fe-auth-oauth.c
@@ -833,41 +833,42 @@ cleanup_oauth_flow(PGconn *conn)
  * failure, and positive indicates success.
  */
 
-#if !defined(USE_LIBCURL)
+#if defined(USE_LIBCURL) && defined(USE_DYNAMIC_OAUTH)
 
 /*
- * This configuration doesn't support the builtin flow.
+ * Use the builtin flow in the libpq-oauth plugin, which is loaded at runtime.
  */
 
-static int
-use_builtin_flow(PGconn *conn, fe_oauth_state *state, PGoauthBearerRequestV2 *request)
-{
-	return 0;
-}
+typedef char *(*libpq_gettext_func) (const char *msgid);
 
-#elif defined(USE_DYNAMIC_OAUTH)
+#elif defined(USE_LIBCURL)
 
 /*
- * Use the builtin flow in the libpq-oauth plugin, which is loaded at runtime.
+ * For static builds, we can just call pg_start_oauthbearer() directly. It's
+ * provided by libpq-oauth.a.
  */
+extern int	pg_start_oauthbearer(PGconn *conn, PGoauthBearerRequestV2 *request);
 
-typedef char *(*libpq_gettext_func) (const char *msgid);
+#endif
 
-/*
- * Loads the libpq-oauth plugin via dlopen(), initializes it, and plugs its
- * callbacks into the connection's async auth handlers.
- *
- * Failure to load here results in a relatively quiet connection error, to
- * handle the use case where the build supports loading a flow but a user does
- * not want to install it. Troubleshooting of linker/loader failures can be done
- * via PGOAUTHDEBUG.
- *
- * The lifetime of *request ends shortly after this call, so it must be copied
- * to longer-lived storage.
- */
 static int
 use_builtin_flow(PGconn *conn, fe_oauth_state *state, PGoauthBearerRequestV2 *request)
 {
+#if !defined(USE_LIBCURL)
+	return 0;
+#elif defined(USE_DYNAMIC_OAUTH)
+	/*
+	 * Load the libpq-oauth plugin via dlopen(), initialize it, and plug its
+	 * callbacks into the connection's async auth handlers.
+	 *
+	 * Failure to load here results in a relatively quiet connection error, to
+	 * handle the use case where the build supports loading a flow but a user
+	 * does not want to install it. Troubleshooting of linker/loader failures
+	 * can be done via PGOAUTHDEBUG.
+	 *
+	 * The lifetime of *request ends shortly after this call, so it must be
+	 * copied to longer-lived storage.
+	 */
 	static bool initialized = false;
 	static pthread_mutex_t init_mutex = PTHREAD_MUTEX_INITIALIZER;
 	int			lockerr;
@@ -976,24 +977,10 @@ use_builtin_flow(PGconn *conn, fe_oauth_state *state, PGoauthBearerRequestV2 *re
 	}
 
 	return (start_flow(conn, request) == 0) ? 1 : -1;
-}
-
 #else
-
-/*
- * For static builds, we can just call pg_start_oauthbearer() directly. It's
- * provided by libpq-oauth.a.
- */
-
-extern int	pg_start_oauthbearer(PGconn *conn, PGoauthBearerRequestV2 *request);
-
-static int
-use_builtin_flow(PGconn *conn, fe_oauth_state *state, PGoauthBearerRequestV2 *request)
-{
 	return (pg_start_oauthbearer(conn, request) == 0) ? 1 : -1;
-}
-
 #endif							/* USE_LIBCURL */
+}
 
 
 /*
-- 
2.53.0


--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
 filename=v1-0002-Collapse-SH_CREATE-into-a-single-definition.patch



^ permalink  raw  reply  [nested|flat] 57+ messages in thread

* [PATCH v1 1/2] libpq-oauth: collapse use_builtin_flow() into a single definition
@ 2026-07-01 10:31 Jonathan Gonzalez V. <[email protected]>
  0 siblings, 0 replies; 57+ messages in thread

From: Jonathan Gonzalez V. @ 2026-07-01 10:31 UTC (permalink / raw)

There was three separated definition of the function making lcov v2.x fail
with an error.
---
 src/interfaces/libpq/fe-auth-oauth.c | 61 +++++++++++-----------------
 1 file changed, 24 insertions(+), 37 deletions(-)

diff --git a/src/interfaces/libpq/fe-auth-oauth.c b/src/interfaces/libpq/fe-auth-oauth.c
index 826f7461cb3..7a35647feb8 100644
--- a/src/interfaces/libpq/fe-auth-oauth.c
+++ b/src/interfaces/libpq/fe-auth-oauth.c
@@ -833,41 +833,42 @@ cleanup_oauth_flow(PGconn *conn)
  * failure, and positive indicates success.
  */
 
-#if !defined(USE_LIBCURL)
+#if defined(USE_LIBCURL) && defined(USE_DYNAMIC_OAUTH)
 
 /*
- * This configuration doesn't support the builtin flow.
+ * Use the builtin flow in the libpq-oauth plugin, which is loaded at runtime.
  */
 
-static int
-use_builtin_flow(PGconn *conn, fe_oauth_state *state, PGoauthBearerRequestV2 *request)
-{
-	return 0;
-}
+typedef char *(*libpq_gettext_func) (const char *msgid);
 
-#elif defined(USE_DYNAMIC_OAUTH)
+#elif defined(USE_LIBCURL)
 
 /*
- * Use the builtin flow in the libpq-oauth plugin, which is loaded at runtime.
+ * For static builds, we can just call pg_start_oauthbearer() directly. It's
+ * provided by libpq-oauth.a.
  */
+extern int	pg_start_oauthbearer(PGconn *conn, PGoauthBearerRequestV2 *request);
 
-typedef char *(*libpq_gettext_func) (const char *msgid);
+#endif
 
-/*
- * Loads the libpq-oauth plugin via dlopen(), initializes it, and plugs its
- * callbacks into the connection's async auth handlers.
- *
- * Failure to load here results in a relatively quiet connection error, to
- * handle the use case where the build supports loading a flow but a user does
- * not want to install it. Troubleshooting of linker/loader failures can be done
- * via PGOAUTHDEBUG.
- *
- * The lifetime of *request ends shortly after this call, so it must be copied
- * to longer-lived storage.
- */
 static int
 use_builtin_flow(PGconn *conn, fe_oauth_state *state, PGoauthBearerRequestV2 *request)
 {
+#if !defined(USE_LIBCURL)
+	return 0;
+#elif defined(USE_DYNAMIC_OAUTH)
+	/*
+	 * Load the libpq-oauth plugin via dlopen(), initialize it, and plug its
+	 * callbacks into the connection's async auth handlers.
+	 *
+	 * Failure to load here results in a relatively quiet connection error, to
+	 * handle the use case where the build supports loading a flow but a user
+	 * does not want to install it. Troubleshooting of linker/loader failures
+	 * can be done via PGOAUTHDEBUG.
+	 *
+	 * The lifetime of *request ends shortly after this call, so it must be
+	 * copied to longer-lived storage.
+	 */
 	static bool initialized = false;
 	static pthread_mutex_t init_mutex = PTHREAD_MUTEX_INITIALIZER;
 	int			lockerr;
@@ -976,24 +977,10 @@ use_builtin_flow(PGconn *conn, fe_oauth_state *state, PGoauthBearerRequestV2 *re
 	}
 
 	return (start_flow(conn, request) == 0) ? 1 : -1;
-}
-
 #else
-
-/*
- * For static builds, we can just call pg_start_oauthbearer() directly. It's
- * provided by libpq-oauth.a.
- */
-
-extern int	pg_start_oauthbearer(PGconn *conn, PGoauthBearerRequestV2 *request);
-
-static int
-use_builtin_flow(PGconn *conn, fe_oauth_state *state, PGoauthBearerRequestV2 *request)
-{
 	return (pg_start_oauthbearer(conn, request) == 0) ? 1 : -1;
-}
-
 #endif							/* USE_LIBCURL */
+}
 
 
 /*
-- 
2.53.0


--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
 filename=v1-0002-Collapse-SH_CREATE-into-a-single-definition.patch



^ permalink  raw  reply  [nested|flat] 57+ messages in thread

* [PATCH v1 1/2] libpq-oauth: collapse use_builtin_flow() into a single definition
@ 2026-07-01 10:31 Jonathan Gonzalez V. <[email protected]>
  0 siblings, 0 replies; 57+ messages in thread

From: Jonathan Gonzalez V. @ 2026-07-01 10:31 UTC (permalink / raw)

There was three separated definition of the function making lcov v2.x fail
with an error.
---
 src/interfaces/libpq/fe-auth-oauth.c | 61 +++++++++++-----------------
 1 file changed, 24 insertions(+), 37 deletions(-)

diff --git a/src/interfaces/libpq/fe-auth-oauth.c b/src/interfaces/libpq/fe-auth-oauth.c
index 826f7461cb3..7a35647feb8 100644
--- a/src/interfaces/libpq/fe-auth-oauth.c
+++ b/src/interfaces/libpq/fe-auth-oauth.c
@@ -833,41 +833,42 @@ cleanup_oauth_flow(PGconn *conn)
  * failure, and positive indicates success.
  */
 
-#if !defined(USE_LIBCURL)
+#if defined(USE_LIBCURL) && defined(USE_DYNAMIC_OAUTH)
 
 /*
- * This configuration doesn't support the builtin flow.
+ * Use the builtin flow in the libpq-oauth plugin, which is loaded at runtime.
  */
 
-static int
-use_builtin_flow(PGconn *conn, fe_oauth_state *state, PGoauthBearerRequestV2 *request)
-{
-	return 0;
-}
+typedef char *(*libpq_gettext_func) (const char *msgid);
 
-#elif defined(USE_DYNAMIC_OAUTH)
+#elif defined(USE_LIBCURL)
 
 /*
- * Use the builtin flow in the libpq-oauth plugin, which is loaded at runtime.
+ * For static builds, we can just call pg_start_oauthbearer() directly. It's
+ * provided by libpq-oauth.a.
  */
+extern int	pg_start_oauthbearer(PGconn *conn, PGoauthBearerRequestV2 *request);
 
-typedef char *(*libpq_gettext_func) (const char *msgid);
+#endif
 
-/*
- * Loads the libpq-oauth plugin via dlopen(), initializes it, and plugs its
- * callbacks into the connection's async auth handlers.
- *
- * Failure to load here results in a relatively quiet connection error, to
- * handle the use case where the build supports loading a flow but a user does
- * not want to install it. Troubleshooting of linker/loader failures can be done
- * via PGOAUTHDEBUG.
- *
- * The lifetime of *request ends shortly after this call, so it must be copied
- * to longer-lived storage.
- */
 static int
 use_builtin_flow(PGconn *conn, fe_oauth_state *state, PGoauthBearerRequestV2 *request)
 {
+#if !defined(USE_LIBCURL)
+	return 0;
+#elif defined(USE_DYNAMIC_OAUTH)
+	/*
+	 * Load the libpq-oauth plugin via dlopen(), initialize it, and plug its
+	 * callbacks into the connection's async auth handlers.
+	 *
+	 * Failure to load here results in a relatively quiet connection error, to
+	 * handle the use case where the build supports loading a flow but a user
+	 * does not want to install it. Troubleshooting of linker/loader failures
+	 * can be done via PGOAUTHDEBUG.
+	 *
+	 * The lifetime of *request ends shortly after this call, so it must be
+	 * copied to longer-lived storage.
+	 */
 	static bool initialized = false;
 	static pthread_mutex_t init_mutex = PTHREAD_MUTEX_INITIALIZER;
 	int			lockerr;
@@ -976,24 +977,10 @@ use_builtin_flow(PGconn *conn, fe_oauth_state *state, PGoauthBearerRequestV2 *re
 	}
 
 	return (start_flow(conn, request) == 0) ? 1 : -1;
-}
-
 #else
-
-/*
- * For static builds, we can just call pg_start_oauthbearer() directly. It's
- * provided by libpq-oauth.a.
- */
-
-extern int	pg_start_oauthbearer(PGconn *conn, PGoauthBearerRequestV2 *request);
-
-static int
-use_builtin_flow(PGconn *conn, fe_oauth_state *state, PGoauthBearerRequestV2 *request)
-{
 	return (pg_start_oauthbearer(conn, request) == 0) ? 1 : -1;
-}
-
 #endif							/* USE_LIBCURL */
+}
 
 
 /*
-- 
2.53.0


--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
 filename=v1-0002-Collapse-SH_CREATE-into-a-single-definition.patch



^ permalink  raw  reply  [nested|flat] 57+ messages in thread

* [PATCH v1 1/2] libpq-oauth: collapse use_builtin_flow() into a single definition
@ 2026-07-01 10:31 Jonathan Gonzalez V. <[email protected]>
  0 siblings, 0 replies; 57+ messages in thread

From: Jonathan Gonzalez V. @ 2026-07-01 10:31 UTC (permalink / raw)

There was three separated definition of the function making lcov v2.x fail
with an error.
---
 src/interfaces/libpq/fe-auth-oauth.c | 61 +++++++++++-----------------
 1 file changed, 24 insertions(+), 37 deletions(-)

diff --git a/src/interfaces/libpq/fe-auth-oauth.c b/src/interfaces/libpq/fe-auth-oauth.c
index 826f7461cb3..7a35647feb8 100644
--- a/src/interfaces/libpq/fe-auth-oauth.c
+++ b/src/interfaces/libpq/fe-auth-oauth.c
@@ -833,41 +833,42 @@ cleanup_oauth_flow(PGconn *conn)
  * failure, and positive indicates success.
  */
 
-#if !defined(USE_LIBCURL)
+#if defined(USE_LIBCURL) && defined(USE_DYNAMIC_OAUTH)
 
 /*
- * This configuration doesn't support the builtin flow.
+ * Use the builtin flow in the libpq-oauth plugin, which is loaded at runtime.
  */
 
-static int
-use_builtin_flow(PGconn *conn, fe_oauth_state *state, PGoauthBearerRequestV2 *request)
-{
-	return 0;
-}
+typedef char *(*libpq_gettext_func) (const char *msgid);
 
-#elif defined(USE_DYNAMIC_OAUTH)
+#elif defined(USE_LIBCURL)
 
 /*
- * Use the builtin flow in the libpq-oauth plugin, which is loaded at runtime.
+ * For static builds, we can just call pg_start_oauthbearer() directly. It's
+ * provided by libpq-oauth.a.
  */
+extern int	pg_start_oauthbearer(PGconn *conn, PGoauthBearerRequestV2 *request);
 
-typedef char *(*libpq_gettext_func) (const char *msgid);
+#endif
 
-/*
- * Loads the libpq-oauth plugin via dlopen(), initializes it, and plugs its
- * callbacks into the connection's async auth handlers.
- *
- * Failure to load here results in a relatively quiet connection error, to
- * handle the use case where the build supports loading a flow but a user does
- * not want to install it. Troubleshooting of linker/loader failures can be done
- * via PGOAUTHDEBUG.
- *
- * The lifetime of *request ends shortly after this call, so it must be copied
- * to longer-lived storage.
- */
 static int
 use_builtin_flow(PGconn *conn, fe_oauth_state *state, PGoauthBearerRequestV2 *request)
 {
+#if !defined(USE_LIBCURL)
+	return 0;
+#elif defined(USE_DYNAMIC_OAUTH)
+	/*
+	 * Load the libpq-oauth plugin via dlopen(), initialize it, and plug its
+	 * callbacks into the connection's async auth handlers.
+	 *
+	 * Failure to load here results in a relatively quiet connection error, to
+	 * handle the use case where the build supports loading a flow but a user
+	 * does not want to install it. Troubleshooting of linker/loader failures
+	 * can be done via PGOAUTHDEBUG.
+	 *
+	 * The lifetime of *request ends shortly after this call, so it must be
+	 * copied to longer-lived storage.
+	 */
 	static bool initialized = false;
 	static pthread_mutex_t init_mutex = PTHREAD_MUTEX_INITIALIZER;
 	int			lockerr;
@@ -976,24 +977,10 @@ use_builtin_flow(PGconn *conn, fe_oauth_state *state, PGoauthBearerRequestV2 *re
 	}
 
 	return (start_flow(conn, request) == 0) ? 1 : -1;
-}
-
 #else
-
-/*
- * For static builds, we can just call pg_start_oauthbearer() directly. It's
- * provided by libpq-oauth.a.
- */
-
-extern int	pg_start_oauthbearer(PGconn *conn, PGoauthBearerRequestV2 *request);
-
-static int
-use_builtin_flow(PGconn *conn, fe_oauth_state *state, PGoauthBearerRequestV2 *request)
-{
 	return (pg_start_oauthbearer(conn, request) == 0) ? 1 : -1;
-}
-
 #endif							/* USE_LIBCURL */
+}
 
 
 /*
-- 
2.53.0


--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
 filename=v1-0002-Collapse-SH_CREATE-into-a-single-definition.patch



^ permalink  raw  reply  [nested|flat] 57+ messages in thread

* [PATCH v1 1/2] libpq-oauth: collapse use_builtin_flow() into a single definition
@ 2026-07-01 10:31 Jonathan Gonzalez V. <[email protected]>
  0 siblings, 0 replies; 57+ messages in thread

From: Jonathan Gonzalez V. @ 2026-07-01 10:31 UTC (permalink / raw)

There was three separated definition of the function making lcov v2.x fail
with an error.
---
 src/interfaces/libpq/fe-auth-oauth.c | 61 +++++++++++-----------------
 1 file changed, 24 insertions(+), 37 deletions(-)

diff --git a/src/interfaces/libpq/fe-auth-oauth.c b/src/interfaces/libpq/fe-auth-oauth.c
index 826f7461cb3..7a35647feb8 100644
--- a/src/interfaces/libpq/fe-auth-oauth.c
+++ b/src/interfaces/libpq/fe-auth-oauth.c
@@ -833,41 +833,42 @@ cleanup_oauth_flow(PGconn *conn)
  * failure, and positive indicates success.
  */
 
-#if !defined(USE_LIBCURL)
+#if defined(USE_LIBCURL) && defined(USE_DYNAMIC_OAUTH)
 
 /*
- * This configuration doesn't support the builtin flow.
+ * Use the builtin flow in the libpq-oauth plugin, which is loaded at runtime.
  */
 
-static int
-use_builtin_flow(PGconn *conn, fe_oauth_state *state, PGoauthBearerRequestV2 *request)
-{
-	return 0;
-}
+typedef char *(*libpq_gettext_func) (const char *msgid);
 
-#elif defined(USE_DYNAMIC_OAUTH)
+#elif defined(USE_LIBCURL)
 
 /*
- * Use the builtin flow in the libpq-oauth plugin, which is loaded at runtime.
+ * For static builds, we can just call pg_start_oauthbearer() directly. It's
+ * provided by libpq-oauth.a.
  */
+extern int	pg_start_oauthbearer(PGconn *conn, PGoauthBearerRequestV2 *request);
 
-typedef char *(*libpq_gettext_func) (const char *msgid);
+#endif
 
-/*
- * Loads the libpq-oauth plugin via dlopen(), initializes it, and plugs its
- * callbacks into the connection's async auth handlers.
- *
- * Failure to load here results in a relatively quiet connection error, to
- * handle the use case where the build supports loading a flow but a user does
- * not want to install it. Troubleshooting of linker/loader failures can be done
- * via PGOAUTHDEBUG.
- *
- * The lifetime of *request ends shortly after this call, so it must be copied
- * to longer-lived storage.
- */
 static int
 use_builtin_flow(PGconn *conn, fe_oauth_state *state, PGoauthBearerRequestV2 *request)
 {
+#if !defined(USE_LIBCURL)
+	return 0;
+#elif defined(USE_DYNAMIC_OAUTH)
+	/*
+	 * Load the libpq-oauth plugin via dlopen(), initialize it, and plug its
+	 * callbacks into the connection's async auth handlers.
+	 *
+	 * Failure to load here results in a relatively quiet connection error, to
+	 * handle the use case where the build supports loading a flow but a user
+	 * does not want to install it. Troubleshooting of linker/loader failures
+	 * can be done via PGOAUTHDEBUG.
+	 *
+	 * The lifetime of *request ends shortly after this call, so it must be
+	 * copied to longer-lived storage.
+	 */
 	static bool initialized = false;
 	static pthread_mutex_t init_mutex = PTHREAD_MUTEX_INITIALIZER;
 	int			lockerr;
@@ -976,24 +977,10 @@ use_builtin_flow(PGconn *conn, fe_oauth_state *state, PGoauthBearerRequestV2 *re
 	}
 
 	return (start_flow(conn, request) == 0) ? 1 : -1;
-}
-
 #else
-
-/*
- * For static builds, we can just call pg_start_oauthbearer() directly. It's
- * provided by libpq-oauth.a.
- */
-
-extern int	pg_start_oauthbearer(PGconn *conn, PGoauthBearerRequestV2 *request);
-
-static int
-use_builtin_flow(PGconn *conn, fe_oauth_state *state, PGoauthBearerRequestV2 *request)
-{
 	return (pg_start_oauthbearer(conn, request) == 0) ? 1 : -1;
-}
-
 #endif							/* USE_LIBCURL */
+}
 
 
 /*
-- 
2.53.0


--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
 filename=v1-0002-Collapse-SH_CREATE-into-a-single-definition.patch



^ permalink  raw  reply  [nested|flat] 57+ messages in thread

* [PATCH v1 1/2] libpq-oauth: collapse use_builtin_flow() into a single definition
@ 2026-07-01 10:31 Jonathan Gonzalez V. <[email protected]>
  0 siblings, 0 replies; 57+ messages in thread

From: Jonathan Gonzalez V. @ 2026-07-01 10:31 UTC (permalink / raw)

There was three separated definition of the function making lcov v2.x fail
with an error.
---
 src/interfaces/libpq/fe-auth-oauth.c | 61 +++++++++++-----------------
 1 file changed, 24 insertions(+), 37 deletions(-)

diff --git a/src/interfaces/libpq/fe-auth-oauth.c b/src/interfaces/libpq/fe-auth-oauth.c
index 826f7461cb3..7a35647feb8 100644
--- a/src/interfaces/libpq/fe-auth-oauth.c
+++ b/src/interfaces/libpq/fe-auth-oauth.c
@@ -833,41 +833,42 @@ cleanup_oauth_flow(PGconn *conn)
  * failure, and positive indicates success.
  */
 
-#if !defined(USE_LIBCURL)
+#if defined(USE_LIBCURL) && defined(USE_DYNAMIC_OAUTH)
 
 /*
- * This configuration doesn't support the builtin flow.
+ * Use the builtin flow in the libpq-oauth plugin, which is loaded at runtime.
  */
 
-static int
-use_builtin_flow(PGconn *conn, fe_oauth_state *state, PGoauthBearerRequestV2 *request)
-{
-	return 0;
-}
+typedef char *(*libpq_gettext_func) (const char *msgid);
 
-#elif defined(USE_DYNAMIC_OAUTH)
+#elif defined(USE_LIBCURL)
 
 /*
- * Use the builtin flow in the libpq-oauth plugin, which is loaded at runtime.
+ * For static builds, we can just call pg_start_oauthbearer() directly. It's
+ * provided by libpq-oauth.a.
  */
+extern int	pg_start_oauthbearer(PGconn *conn, PGoauthBearerRequestV2 *request);
 
-typedef char *(*libpq_gettext_func) (const char *msgid);
+#endif
 
-/*
- * Loads the libpq-oauth plugin via dlopen(), initializes it, and plugs its
- * callbacks into the connection's async auth handlers.
- *
- * Failure to load here results in a relatively quiet connection error, to
- * handle the use case where the build supports loading a flow but a user does
- * not want to install it. Troubleshooting of linker/loader failures can be done
- * via PGOAUTHDEBUG.
- *
- * The lifetime of *request ends shortly after this call, so it must be copied
- * to longer-lived storage.
- */
 static int
 use_builtin_flow(PGconn *conn, fe_oauth_state *state, PGoauthBearerRequestV2 *request)
 {
+#if !defined(USE_LIBCURL)
+	return 0;
+#elif defined(USE_DYNAMIC_OAUTH)
+	/*
+	 * Load the libpq-oauth plugin via dlopen(), initialize it, and plug its
+	 * callbacks into the connection's async auth handlers.
+	 *
+	 * Failure to load here results in a relatively quiet connection error, to
+	 * handle the use case where the build supports loading a flow but a user
+	 * does not want to install it. Troubleshooting of linker/loader failures
+	 * can be done via PGOAUTHDEBUG.
+	 *
+	 * The lifetime of *request ends shortly after this call, so it must be
+	 * copied to longer-lived storage.
+	 */
 	static bool initialized = false;
 	static pthread_mutex_t init_mutex = PTHREAD_MUTEX_INITIALIZER;
 	int			lockerr;
@@ -976,24 +977,10 @@ use_builtin_flow(PGconn *conn, fe_oauth_state *state, PGoauthBearerRequestV2 *re
 	}
 
 	return (start_flow(conn, request) == 0) ? 1 : -1;
-}
-
 #else
-
-/*
- * For static builds, we can just call pg_start_oauthbearer() directly. It's
- * provided by libpq-oauth.a.
- */
-
-extern int	pg_start_oauthbearer(PGconn *conn, PGoauthBearerRequestV2 *request);
-
-static int
-use_builtin_flow(PGconn *conn, fe_oauth_state *state, PGoauthBearerRequestV2 *request)
-{
 	return (pg_start_oauthbearer(conn, request) == 0) ? 1 : -1;
-}
-
 #endif							/* USE_LIBCURL */
+}
 
 
 /*
-- 
2.53.0


--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
 filename=v1-0002-Collapse-SH_CREATE-into-a-single-definition.patch



^ permalink  raw  reply  [nested|flat] 57+ messages in thread

* [PATCH v1 1/2] libpq-oauth: collapse use_builtin_flow() into a single definition
@ 2026-07-01 10:31 Jonathan Gonzalez V. <[email protected]>
  0 siblings, 0 replies; 57+ messages in thread

From: Jonathan Gonzalez V. @ 2026-07-01 10:31 UTC (permalink / raw)

There was three separated definition of the function making lcov v2.x fail
with an error.
---
 src/interfaces/libpq/fe-auth-oauth.c | 61 +++++++++++-----------------
 1 file changed, 24 insertions(+), 37 deletions(-)

diff --git a/src/interfaces/libpq/fe-auth-oauth.c b/src/interfaces/libpq/fe-auth-oauth.c
index 826f7461cb3..7a35647feb8 100644
--- a/src/interfaces/libpq/fe-auth-oauth.c
+++ b/src/interfaces/libpq/fe-auth-oauth.c
@@ -833,41 +833,42 @@ cleanup_oauth_flow(PGconn *conn)
  * failure, and positive indicates success.
  */
 
-#if !defined(USE_LIBCURL)
+#if defined(USE_LIBCURL) && defined(USE_DYNAMIC_OAUTH)
 
 /*
- * This configuration doesn't support the builtin flow.
+ * Use the builtin flow in the libpq-oauth plugin, which is loaded at runtime.
  */
 
-static int
-use_builtin_flow(PGconn *conn, fe_oauth_state *state, PGoauthBearerRequestV2 *request)
-{
-	return 0;
-}
+typedef char *(*libpq_gettext_func) (const char *msgid);
 
-#elif defined(USE_DYNAMIC_OAUTH)
+#elif defined(USE_LIBCURL)
 
 /*
- * Use the builtin flow in the libpq-oauth plugin, which is loaded at runtime.
+ * For static builds, we can just call pg_start_oauthbearer() directly. It's
+ * provided by libpq-oauth.a.
  */
+extern int	pg_start_oauthbearer(PGconn *conn, PGoauthBearerRequestV2 *request);
 
-typedef char *(*libpq_gettext_func) (const char *msgid);
+#endif
 
-/*
- * Loads the libpq-oauth plugin via dlopen(), initializes it, and plugs its
- * callbacks into the connection's async auth handlers.
- *
- * Failure to load here results in a relatively quiet connection error, to
- * handle the use case where the build supports loading a flow but a user does
- * not want to install it. Troubleshooting of linker/loader failures can be done
- * via PGOAUTHDEBUG.
- *
- * The lifetime of *request ends shortly after this call, so it must be copied
- * to longer-lived storage.
- */
 static int
 use_builtin_flow(PGconn *conn, fe_oauth_state *state, PGoauthBearerRequestV2 *request)
 {
+#if !defined(USE_LIBCURL)
+	return 0;
+#elif defined(USE_DYNAMIC_OAUTH)
+	/*
+	 * Load the libpq-oauth plugin via dlopen(), initialize it, and plug its
+	 * callbacks into the connection's async auth handlers.
+	 *
+	 * Failure to load here results in a relatively quiet connection error, to
+	 * handle the use case where the build supports loading a flow but a user
+	 * does not want to install it. Troubleshooting of linker/loader failures
+	 * can be done via PGOAUTHDEBUG.
+	 *
+	 * The lifetime of *request ends shortly after this call, so it must be
+	 * copied to longer-lived storage.
+	 */
 	static bool initialized = false;
 	static pthread_mutex_t init_mutex = PTHREAD_MUTEX_INITIALIZER;
 	int			lockerr;
@@ -976,24 +977,10 @@ use_builtin_flow(PGconn *conn, fe_oauth_state *state, PGoauthBearerRequestV2 *re
 	}
 
 	return (start_flow(conn, request) == 0) ? 1 : -1;
-}
-
 #else
-
-/*
- * For static builds, we can just call pg_start_oauthbearer() directly. It's
- * provided by libpq-oauth.a.
- */
-
-extern int	pg_start_oauthbearer(PGconn *conn, PGoauthBearerRequestV2 *request);
-
-static int
-use_builtin_flow(PGconn *conn, fe_oauth_state *state, PGoauthBearerRequestV2 *request)
-{
 	return (pg_start_oauthbearer(conn, request) == 0) ? 1 : -1;
-}
-
 #endif							/* USE_LIBCURL */
+}
 
 
 /*
-- 
2.53.0


--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
 filename=v1-0002-Collapse-SH_CREATE-into-a-single-definition.patch



^ permalink  raw  reply  [nested|flat] 57+ messages in thread

* [PATCH v1 1/2] libpq-oauth: collapse use_builtin_flow() into a single definition
@ 2026-07-01 10:31 Jonathan Gonzalez V. <[email protected]>
  0 siblings, 0 replies; 57+ messages in thread

From: Jonathan Gonzalez V. @ 2026-07-01 10:31 UTC (permalink / raw)

There was three separated definition of the function making lcov v2.x fail
with an error.
---
 src/interfaces/libpq/fe-auth-oauth.c | 61 +++++++++++-----------------
 1 file changed, 24 insertions(+), 37 deletions(-)

diff --git a/src/interfaces/libpq/fe-auth-oauth.c b/src/interfaces/libpq/fe-auth-oauth.c
index 826f7461cb3..7a35647feb8 100644
--- a/src/interfaces/libpq/fe-auth-oauth.c
+++ b/src/interfaces/libpq/fe-auth-oauth.c
@@ -833,41 +833,42 @@ cleanup_oauth_flow(PGconn *conn)
  * failure, and positive indicates success.
  */
 
-#if !defined(USE_LIBCURL)
+#if defined(USE_LIBCURL) && defined(USE_DYNAMIC_OAUTH)
 
 /*
- * This configuration doesn't support the builtin flow.
+ * Use the builtin flow in the libpq-oauth plugin, which is loaded at runtime.
  */
 
-static int
-use_builtin_flow(PGconn *conn, fe_oauth_state *state, PGoauthBearerRequestV2 *request)
-{
-	return 0;
-}
+typedef char *(*libpq_gettext_func) (const char *msgid);
 
-#elif defined(USE_DYNAMIC_OAUTH)
+#elif defined(USE_LIBCURL)
 
 /*
- * Use the builtin flow in the libpq-oauth plugin, which is loaded at runtime.
+ * For static builds, we can just call pg_start_oauthbearer() directly. It's
+ * provided by libpq-oauth.a.
  */
+extern int	pg_start_oauthbearer(PGconn *conn, PGoauthBearerRequestV2 *request);
 
-typedef char *(*libpq_gettext_func) (const char *msgid);
+#endif
 
-/*
- * Loads the libpq-oauth plugin via dlopen(), initializes it, and plugs its
- * callbacks into the connection's async auth handlers.
- *
- * Failure to load here results in a relatively quiet connection error, to
- * handle the use case where the build supports loading a flow but a user does
- * not want to install it. Troubleshooting of linker/loader failures can be done
- * via PGOAUTHDEBUG.
- *
- * The lifetime of *request ends shortly after this call, so it must be copied
- * to longer-lived storage.
- */
 static int
 use_builtin_flow(PGconn *conn, fe_oauth_state *state, PGoauthBearerRequestV2 *request)
 {
+#if !defined(USE_LIBCURL)
+	return 0;
+#elif defined(USE_DYNAMIC_OAUTH)
+	/*
+	 * Load the libpq-oauth plugin via dlopen(), initialize it, and plug its
+	 * callbacks into the connection's async auth handlers.
+	 *
+	 * Failure to load here results in a relatively quiet connection error, to
+	 * handle the use case where the build supports loading a flow but a user
+	 * does not want to install it. Troubleshooting of linker/loader failures
+	 * can be done via PGOAUTHDEBUG.
+	 *
+	 * The lifetime of *request ends shortly after this call, so it must be
+	 * copied to longer-lived storage.
+	 */
 	static bool initialized = false;
 	static pthread_mutex_t init_mutex = PTHREAD_MUTEX_INITIALIZER;
 	int			lockerr;
@@ -976,24 +977,10 @@ use_builtin_flow(PGconn *conn, fe_oauth_state *state, PGoauthBearerRequestV2 *re
 	}
 
 	return (start_flow(conn, request) == 0) ? 1 : -1;
-}
-
 #else
-
-/*
- * For static builds, we can just call pg_start_oauthbearer() directly. It's
- * provided by libpq-oauth.a.
- */
-
-extern int	pg_start_oauthbearer(PGconn *conn, PGoauthBearerRequestV2 *request);
-
-static int
-use_builtin_flow(PGconn *conn, fe_oauth_state *state, PGoauthBearerRequestV2 *request)
-{
 	return (pg_start_oauthbearer(conn, request) == 0) ? 1 : -1;
-}
-
 #endif							/* USE_LIBCURL */
+}
 
 
 /*
-- 
2.53.0


--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
 filename=v1-0002-Collapse-SH_CREATE-into-a-single-definition.patch



^ permalink  raw  reply  [nested|flat] 57+ messages in thread

* [PATCH v1 1/2] libpq-oauth: collapse use_builtin_flow() into a single definition
@ 2026-07-01 10:31 Jonathan Gonzalez V. <[email protected]>
  0 siblings, 0 replies; 57+ messages in thread

From: Jonathan Gonzalez V. @ 2026-07-01 10:31 UTC (permalink / raw)

There was three separated definition of the function making lcov v2.x fail
with an error.
---
 src/interfaces/libpq/fe-auth-oauth.c | 61 +++++++++++-----------------
 1 file changed, 24 insertions(+), 37 deletions(-)

diff --git a/src/interfaces/libpq/fe-auth-oauth.c b/src/interfaces/libpq/fe-auth-oauth.c
index 826f7461cb3..7a35647feb8 100644
--- a/src/interfaces/libpq/fe-auth-oauth.c
+++ b/src/interfaces/libpq/fe-auth-oauth.c
@@ -833,41 +833,42 @@ cleanup_oauth_flow(PGconn *conn)
  * failure, and positive indicates success.
  */
 
-#if !defined(USE_LIBCURL)
+#if defined(USE_LIBCURL) && defined(USE_DYNAMIC_OAUTH)
 
 /*
- * This configuration doesn't support the builtin flow.
+ * Use the builtin flow in the libpq-oauth plugin, which is loaded at runtime.
  */
 
-static int
-use_builtin_flow(PGconn *conn, fe_oauth_state *state, PGoauthBearerRequestV2 *request)
-{
-	return 0;
-}
+typedef char *(*libpq_gettext_func) (const char *msgid);
 
-#elif defined(USE_DYNAMIC_OAUTH)
+#elif defined(USE_LIBCURL)
 
 /*
- * Use the builtin flow in the libpq-oauth plugin, which is loaded at runtime.
+ * For static builds, we can just call pg_start_oauthbearer() directly. It's
+ * provided by libpq-oauth.a.
  */
+extern int	pg_start_oauthbearer(PGconn *conn, PGoauthBearerRequestV2 *request);
 
-typedef char *(*libpq_gettext_func) (const char *msgid);
+#endif
 
-/*
- * Loads the libpq-oauth plugin via dlopen(), initializes it, and plugs its
- * callbacks into the connection's async auth handlers.
- *
- * Failure to load here results in a relatively quiet connection error, to
- * handle the use case where the build supports loading a flow but a user does
- * not want to install it. Troubleshooting of linker/loader failures can be done
- * via PGOAUTHDEBUG.
- *
- * The lifetime of *request ends shortly after this call, so it must be copied
- * to longer-lived storage.
- */
 static int
 use_builtin_flow(PGconn *conn, fe_oauth_state *state, PGoauthBearerRequestV2 *request)
 {
+#if !defined(USE_LIBCURL)
+	return 0;
+#elif defined(USE_DYNAMIC_OAUTH)
+	/*
+	 * Load the libpq-oauth plugin via dlopen(), initialize it, and plug its
+	 * callbacks into the connection's async auth handlers.
+	 *
+	 * Failure to load here results in a relatively quiet connection error, to
+	 * handle the use case where the build supports loading a flow but a user
+	 * does not want to install it. Troubleshooting of linker/loader failures
+	 * can be done via PGOAUTHDEBUG.
+	 *
+	 * The lifetime of *request ends shortly after this call, so it must be
+	 * copied to longer-lived storage.
+	 */
 	static bool initialized = false;
 	static pthread_mutex_t init_mutex = PTHREAD_MUTEX_INITIALIZER;
 	int			lockerr;
@@ -976,24 +977,10 @@ use_builtin_flow(PGconn *conn, fe_oauth_state *state, PGoauthBearerRequestV2 *re
 	}
 
 	return (start_flow(conn, request) == 0) ? 1 : -1;
-}
-
 #else
-
-/*
- * For static builds, we can just call pg_start_oauthbearer() directly. It's
- * provided by libpq-oauth.a.
- */
-
-extern int	pg_start_oauthbearer(PGconn *conn, PGoauthBearerRequestV2 *request);
-
-static int
-use_builtin_flow(PGconn *conn, fe_oauth_state *state, PGoauthBearerRequestV2 *request)
-{
 	return (pg_start_oauthbearer(conn, request) == 0) ? 1 : -1;
-}
-
 #endif							/* USE_LIBCURL */
+}
 
 
 /*
-- 
2.53.0


--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
 filename=v1-0002-Collapse-SH_CREATE-into-a-single-definition.patch



^ permalink  raw  reply  [nested|flat] 57+ messages in thread

* [PATCH v1 1/2] libpq-oauth: collapse use_builtin_flow() into a single definition
@ 2026-07-01 10:31 Jonathan Gonzalez V. <[email protected]>
  0 siblings, 0 replies; 57+ messages in thread

From: Jonathan Gonzalez V. @ 2026-07-01 10:31 UTC (permalink / raw)

There was three separated definition of the function making lcov v2.x fail
with an error.
---
 src/interfaces/libpq/fe-auth-oauth.c | 61 +++++++++++-----------------
 1 file changed, 24 insertions(+), 37 deletions(-)

diff --git a/src/interfaces/libpq/fe-auth-oauth.c b/src/interfaces/libpq/fe-auth-oauth.c
index 826f7461cb3..7a35647feb8 100644
--- a/src/interfaces/libpq/fe-auth-oauth.c
+++ b/src/interfaces/libpq/fe-auth-oauth.c
@@ -833,41 +833,42 @@ cleanup_oauth_flow(PGconn *conn)
  * failure, and positive indicates success.
  */
 
-#if !defined(USE_LIBCURL)
+#if defined(USE_LIBCURL) && defined(USE_DYNAMIC_OAUTH)
 
 /*
- * This configuration doesn't support the builtin flow.
+ * Use the builtin flow in the libpq-oauth plugin, which is loaded at runtime.
  */
 
-static int
-use_builtin_flow(PGconn *conn, fe_oauth_state *state, PGoauthBearerRequestV2 *request)
-{
-	return 0;
-}
+typedef char *(*libpq_gettext_func) (const char *msgid);
 
-#elif defined(USE_DYNAMIC_OAUTH)
+#elif defined(USE_LIBCURL)
 
 /*
- * Use the builtin flow in the libpq-oauth plugin, which is loaded at runtime.
+ * For static builds, we can just call pg_start_oauthbearer() directly. It's
+ * provided by libpq-oauth.a.
  */
+extern int	pg_start_oauthbearer(PGconn *conn, PGoauthBearerRequestV2 *request);
 
-typedef char *(*libpq_gettext_func) (const char *msgid);
+#endif
 
-/*
- * Loads the libpq-oauth plugin via dlopen(), initializes it, and plugs its
- * callbacks into the connection's async auth handlers.
- *
- * Failure to load here results in a relatively quiet connection error, to
- * handle the use case where the build supports loading a flow but a user does
- * not want to install it. Troubleshooting of linker/loader failures can be done
- * via PGOAUTHDEBUG.
- *
- * The lifetime of *request ends shortly after this call, so it must be copied
- * to longer-lived storage.
- */
 static int
 use_builtin_flow(PGconn *conn, fe_oauth_state *state, PGoauthBearerRequestV2 *request)
 {
+#if !defined(USE_LIBCURL)
+	return 0;
+#elif defined(USE_DYNAMIC_OAUTH)
+	/*
+	 * Load the libpq-oauth plugin via dlopen(), initialize it, and plug its
+	 * callbacks into the connection's async auth handlers.
+	 *
+	 * Failure to load here results in a relatively quiet connection error, to
+	 * handle the use case where the build supports loading a flow but a user
+	 * does not want to install it. Troubleshooting of linker/loader failures
+	 * can be done via PGOAUTHDEBUG.
+	 *
+	 * The lifetime of *request ends shortly after this call, so it must be
+	 * copied to longer-lived storage.
+	 */
 	static bool initialized = false;
 	static pthread_mutex_t init_mutex = PTHREAD_MUTEX_INITIALIZER;
 	int			lockerr;
@@ -976,24 +977,10 @@ use_builtin_flow(PGconn *conn, fe_oauth_state *state, PGoauthBearerRequestV2 *re
 	}
 
 	return (start_flow(conn, request) == 0) ? 1 : -1;
-}
-
 #else
-
-/*
- * For static builds, we can just call pg_start_oauthbearer() directly. It's
- * provided by libpq-oauth.a.
- */
-
-extern int	pg_start_oauthbearer(PGconn *conn, PGoauthBearerRequestV2 *request);
-
-static int
-use_builtin_flow(PGconn *conn, fe_oauth_state *state, PGoauthBearerRequestV2 *request)
-{
 	return (pg_start_oauthbearer(conn, request) == 0) ? 1 : -1;
-}
-
 #endif							/* USE_LIBCURL */
+}
 
 
 /*
-- 
2.53.0


--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
 filename=v1-0002-Collapse-SH_CREATE-into-a-single-definition.patch



^ permalink  raw  reply  [nested|flat] 57+ messages in thread

* [PATCH v1 1/2] libpq-oauth: collapse use_builtin_flow() into a single definition
@ 2026-07-01 10:31 Jonathan Gonzalez V. <[email protected]>
  0 siblings, 0 replies; 57+ messages in thread

From: Jonathan Gonzalez V. @ 2026-07-01 10:31 UTC (permalink / raw)

There was three separated definition of the function making lcov v2.x fail
with an error.
---
 src/interfaces/libpq/fe-auth-oauth.c | 61 +++++++++++-----------------
 1 file changed, 24 insertions(+), 37 deletions(-)

diff --git a/src/interfaces/libpq/fe-auth-oauth.c b/src/interfaces/libpq/fe-auth-oauth.c
index 826f7461cb3..7a35647feb8 100644
--- a/src/interfaces/libpq/fe-auth-oauth.c
+++ b/src/interfaces/libpq/fe-auth-oauth.c
@@ -833,41 +833,42 @@ cleanup_oauth_flow(PGconn *conn)
  * failure, and positive indicates success.
  */
 
-#if !defined(USE_LIBCURL)
+#if defined(USE_LIBCURL) && defined(USE_DYNAMIC_OAUTH)
 
 /*
- * This configuration doesn't support the builtin flow.
+ * Use the builtin flow in the libpq-oauth plugin, which is loaded at runtime.
  */
 
-static int
-use_builtin_flow(PGconn *conn, fe_oauth_state *state, PGoauthBearerRequestV2 *request)
-{
-	return 0;
-}
+typedef char *(*libpq_gettext_func) (const char *msgid);
 
-#elif defined(USE_DYNAMIC_OAUTH)
+#elif defined(USE_LIBCURL)
 
 /*
- * Use the builtin flow in the libpq-oauth plugin, which is loaded at runtime.
+ * For static builds, we can just call pg_start_oauthbearer() directly. It's
+ * provided by libpq-oauth.a.
  */
+extern int	pg_start_oauthbearer(PGconn *conn, PGoauthBearerRequestV2 *request);
 
-typedef char *(*libpq_gettext_func) (const char *msgid);
+#endif
 
-/*
- * Loads the libpq-oauth plugin via dlopen(), initializes it, and plugs its
- * callbacks into the connection's async auth handlers.
- *
- * Failure to load here results in a relatively quiet connection error, to
- * handle the use case where the build supports loading a flow but a user does
- * not want to install it. Troubleshooting of linker/loader failures can be done
- * via PGOAUTHDEBUG.
- *
- * The lifetime of *request ends shortly after this call, so it must be copied
- * to longer-lived storage.
- */
 static int
 use_builtin_flow(PGconn *conn, fe_oauth_state *state, PGoauthBearerRequestV2 *request)
 {
+#if !defined(USE_LIBCURL)
+	return 0;
+#elif defined(USE_DYNAMIC_OAUTH)
+	/*
+	 * Load the libpq-oauth plugin via dlopen(), initialize it, and plug its
+	 * callbacks into the connection's async auth handlers.
+	 *
+	 * Failure to load here results in a relatively quiet connection error, to
+	 * handle the use case where the build supports loading a flow but a user
+	 * does not want to install it. Troubleshooting of linker/loader failures
+	 * can be done via PGOAUTHDEBUG.
+	 *
+	 * The lifetime of *request ends shortly after this call, so it must be
+	 * copied to longer-lived storage.
+	 */
 	static bool initialized = false;
 	static pthread_mutex_t init_mutex = PTHREAD_MUTEX_INITIALIZER;
 	int			lockerr;
@@ -976,24 +977,10 @@ use_builtin_flow(PGconn *conn, fe_oauth_state *state, PGoauthBearerRequestV2 *re
 	}
 
 	return (start_flow(conn, request) == 0) ? 1 : -1;
-}
-
 #else
-
-/*
- * For static builds, we can just call pg_start_oauthbearer() directly. It's
- * provided by libpq-oauth.a.
- */
-
-extern int	pg_start_oauthbearer(PGconn *conn, PGoauthBearerRequestV2 *request);
-
-static int
-use_builtin_flow(PGconn *conn, fe_oauth_state *state, PGoauthBearerRequestV2 *request)
-{
 	return (pg_start_oauthbearer(conn, request) == 0) ? 1 : -1;
-}
-
 #endif							/* USE_LIBCURL */
+}
 
 
 /*
-- 
2.53.0


--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
 filename=v1-0002-Collapse-SH_CREATE-into-a-single-definition.patch



^ permalink  raw  reply  [nested|flat] 57+ messages in thread

* [PATCH v1 1/2] libpq-oauth: collapse use_builtin_flow() into a single definition
@ 2026-07-01 10:31 Jonathan Gonzalez V. <[email protected]>
  0 siblings, 0 replies; 57+ messages in thread

From: Jonathan Gonzalez V. @ 2026-07-01 10:31 UTC (permalink / raw)

There was three separated definition of the function making lcov v2.x fail
with an error.
---
 src/interfaces/libpq/fe-auth-oauth.c | 61 +++++++++++-----------------
 1 file changed, 24 insertions(+), 37 deletions(-)

diff --git a/src/interfaces/libpq/fe-auth-oauth.c b/src/interfaces/libpq/fe-auth-oauth.c
index 826f7461cb3..7a35647feb8 100644
--- a/src/interfaces/libpq/fe-auth-oauth.c
+++ b/src/interfaces/libpq/fe-auth-oauth.c
@@ -833,41 +833,42 @@ cleanup_oauth_flow(PGconn *conn)
  * failure, and positive indicates success.
  */
 
-#if !defined(USE_LIBCURL)
+#if defined(USE_LIBCURL) && defined(USE_DYNAMIC_OAUTH)
 
 /*
- * This configuration doesn't support the builtin flow.
+ * Use the builtin flow in the libpq-oauth plugin, which is loaded at runtime.
  */
 
-static int
-use_builtin_flow(PGconn *conn, fe_oauth_state *state, PGoauthBearerRequestV2 *request)
-{
-	return 0;
-}
+typedef char *(*libpq_gettext_func) (const char *msgid);
 
-#elif defined(USE_DYNAMIC_OAUTH)
+#elif defined(USE_LIBCURL)
 
 /*
- * Use the builtin flow in the libpq-oauth plugin, which is loaded at runtime.
+ * For static builds, we can just call pg_start_oauthbearer() directly. It's
+ * provided by libpq-oauth.a.
  */
+extern int	pg_start_oauthbearer(PGconn *conn, PGoauthBearerRequestV2 *request);
 
-typedef char *(*libpq_gettext_func) (const char *msgid);
+#endif
 
-/*
- * Loads the libpq-oauth plugin via dlopen(), initializes it, and plugs its
- * callbacks into the connection's async auth handlers.
- *
- * Failure to load here results in a relatively quiet connection error, to
- * handle the use case where the build supports loading a flow but a user does
- * not want to install it. Troubleshooting of linker/loader failures can be done
- * via PGOAUTHDEBUG.
- *
- * The lifetime of *request ends shortly after this call, so it must be copied
- * to longer-lived storage.
- */
 static int
 use_builtin_flow(PGconn *conn, fe_oauth_state *state, PGoauthBearerRequestV2 *request)
 {
+#if !defined(USE_LIBCURL)
+	return 0;
+#elif defined(USE_DYNAMIC_OAUTH)
+	/*
+	 * Load the libpq-oauth plugin via dlopen(), initialize it, and plug its
+	 * callbacks into the connection's async auth handlers.
+	 *
+	 * Failure to load here results in a relatively quiet connection error, to
+	 * handle the use case where the build supports loading a flow but a user
+	 * does not want to install it. Troubleshooting of linker/loader failures
+	 * can be done via PGOAUTHDEBUG.
+	 *
+	 * The lifetime of *request ends shortly after this call, so it must be
+	 * copied to longer-lived storage.
+	 */
 	static bool initialized = false;
 	static pthread_mutex_t init_mutex = PTHREAD_MUTEX_INITIALIZER;
 	int			lockerr;
@@ -976,24 +977,10 @@ use_builtin_flow(PGconn *conn, fe_oauth_state *state, PGoauthBearerRequestV2 *re
 	}
 
 	return (start_flow(conn, request) == 0) ? 1 : -1;
-}
-
 #else
-
-/*
- * For static builds, we can just call pg_start_oauthbearer() directly. It's
- * provided by libpq-oauth.a.
- */
-
-extern int	pg_start_oauthbearer(PGconn *conn, PGoauthBearerRequestV2 *request);
-
-static int
-use_builtin_flow(PGconn *conn, fe_oauth_state *state, PGoauthBearerRequestV2 *request)
-{
 	return (pg_start_oauthbearer(conn, request) == 0) ? 1 : -1;
-}
-
 #endif							/* USE_LIBCURL */
+}
 
 
 /*
-- 
2.53.0


--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
 filename=v1-0002-Collapse-SH_CREATE-into-a-single-definition.patch



^ permalink  raw  reply  [nested|flat] 57+ messages in thread

* [PATCH v1 1/2] libpq-oauth: collapse use_builtin_flow() into a single definition
@ 2026-07-01 10:31 Jonathan Gonzalez V. <[email protected]>
  0 siblings, 0 replies; 57+ messages in thread

From: Jonathan Gonzalez V. @ 2026-07-01 10:31 UTC (permalink / raw)

There was three separated definition of the function making lcov v2.x fail
with an error.
---
 src/interfaces/libpq/fe-auth-oauth.c | 61 +++++++++++-----------------
 1 file changed, 24 insertions(+), 37 deletions(-)

diff --git a/src/interfaces/libpq/fe-auth-oauth.c b/src/interfaces/libpq/fe-auth-oauth.c
index 826f7461cb3..7a35647feb8 100644
--- a/src/interfaces/libpq/fe-auth-oauth.c
+++ b/src/interfaces/libpq/fe-auth-oauth.c
@@ -833,41 +833,42 @@ cleanup_oauth_flow(PGconn *conn)
  * failure, and positive indicates success.
  */
 
-#if !defined(USE_LIBCURL)
+#if defined(USE_LIBCURL) && defined(USE_DYNAMIC_OAUTH)
 
 /*
- * This configuration doesn't support the builtin flow.
+ * Use the builtin flow in the libpq-oauth plugin, which is loaded at runtime.
  */
 
-static int
-use_builtin_flow(PGconn *conn, fe_oauth_state *state, PGoauthBearerRequestV2 *request)
-{
-	return 0;
-}
+typedef char *(*libpq_gettext_func) (const char *msgid);
 
-#elif defined(USE_DYNAMIC_OAUTH)
+#elif defined(USE_LIBCURL)
 
 /*
- * Use the builtin flow in the libpq-oauth plugin, which is loaded at runtime.
+ * For static builds, we can just call pg_start_oauthbearer() directly. It's
+ * provided by libpq-oauth.a.
  */
+extern int	pg_start_oauthbearer(PGconn *conn, PGoauthBearerRequestV2 *request);
 
-typedef char *(*libpq_gettext_func) (const char *msgid);
+#endif
 
-/*
- * Loads the libpq-oauth plugin via dlopen(), initializes it, and plugs its
- * callbacks into the connection's async auth handlers.
- *
- * Failure to load here results in a relatively quiet connection error, to
- * handle the use case where the build supports loading a flow but a user does
- * not want to install it. Troubleshooting of linker/loader failures can be done
- * via PGOAUTHDEBUG.
- *
- * The lifetime of *request ends shortly after this call, so it must be copied
- * to longer-lived storage.
- */
 static int
 use_builtin_flow(PGconn *conn, fe_oauth_state *state, PGoauthBearerRequestV2 *request)
 {
+#if !defined(USE_LIBCURL)
+	return 0;
+#elif defined(USE_DYNAMIC_OAUTH)
+	/*
+	 * Load the libpq-oauth plugin via dlopen(), initialize it, and plug its
+	 * callbacks into the connection's async auth handlers.
+	 *
+	 * Failure to load here results in a relatively quiet connection error, to
+	 * handle the use case where the build supports loading a flow but a user
+	 * does not want to install it. Troubleshooting of linker/loader failures
+	 * can be done via PGOAUTHDEBUG.
+	 *
+	 * The lifetime of *request ends shortly after this call, so it must be
+	 * copied to longer-lived storage.
+	 */
 	static bool initialized = false;
 	static pthread_mutex_t init_mutex = PTHREAD_MUTEX_INITIALIZER;
 	int			lockerr;
@@ -976,24 +977,10 @@ use_builtin_flow(PGconn *conn, fe_oauth_state *state, PGoauthBearerRequestV2 *re
 	}
 
 	return (start_flow(conn, request) == 0) ? 1 : -1;
-}
-
 #else
-
-/*
- * For static builds, we can just call pg_start_oauthbearer() directly. It's
- * provided by libpq-oauth.a.
- */
-
-extern int	pg_start_oauthbearer(PGconn *conn, PGoauthBearerRequestV2 *request);
-
-static int
-use_builtin_flow(PGconn *conn, fe_oauth_state *state, PGoauthBearerRequestV2 *request)
-{
 	return (pg_start_oauthbearer(conn, request) == 0) ? 1 : -1;
-}
-
 #endif							/* USE_LIBCURL */
+}
 
 
 /*
-- 
2.53.0


--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
 filename=v1-0002-Collapse-SH_CREATE-into-a-single-definition.patch



^ permalink  raw  reply  [nested|flat] 57+ messages in thread

* [PATCH v1 1/2] libpq-oauth: collapse use_builtin_flow() into a single definition
@ 2026-07-01 10:31 Jonathan Gonzalez V. <[email protected]>
  0 siblings, 0 replies; 57+ messages in thread

From: Jonathan Gonzalez V. @ 2026-07-01 10:31 UTC (permalink / raw)

There was three separated definition of the function making lcov v2.x fail
with an error.
---
 src/interfaces/libpq/fe-auth-oauth.c | 61 +++++++++++-----------------
 1 file changed, 24 insertions(+), 37 deletions(-)

diff --git a/src/interfaces/libpq/fe-auth-oauth.c b/src/interfaces/libpq/fe-auth-oauth.c
index 826f7461cb3..7a35647feb8 100644
--- a/src/interfaces/libpq/fe-auth-oauth.c
+++ b/src/interfaces/libpq/fe-auth-oauth.c
@@ -833,41 +833,42 @@ cleanup_oauth_flow(PGconn *conn)
  * failure, and positive indicates success.
  */
 
-#if !defined(USE_LIBCURL)
+#if defined(USE_LIBCURL) && defined(USE_DYNAMIC_OAUTH)
 
 /*
- * This configuration doesn't support the builtin flow.
+ * Use the builtin flow in the libpq-oauth plugin, which is loaded at runtime.
  */
 
-static int
-use_builtin_flow(PGconn *conn, fe_oauth_state *state, PGoauthBearerRequestV2 *request)
-{
-	return 0;
-}
+typedef char *(*libpq_gettext_func) (const char *msgid);
 
-#elif defined(USE_DYNAMIC_OAUTH)
+#elif defined(USE_LIBCURL)
 
 /*
- * Use the builtin flow in the libpq-oauth plugin, which is loaded at runtime.
+ * For static builds, we can just call pg_start_oauthbearer() directly. It's
+ * provided by libpq-oauth.a.
  */
+extern int	pg_start_oauthbearer(PGconn *conn, PGoauthBearerRequestV2 *request);
 
-typedef char *(*libpq_gettext_func) (const char *msgid);
+#endif
 
-/*
- * Loads the libpq-oauth plugin via dlopen(), initializes it, and plugs its
- * callbacks into the connection's async auth handlers.
- *
- * Failure to load here results in a relatively quiet connection error, to
- * handle the use case where the build supports loading a flow but a user does
- * not want to install it. Troubleshooting of linker/loader failures can be done
- * via PGOAUTHDEBUG.
- *
- * The lifetime of *request ends shortly after this call, so it must be copied
- * to longer-lived storage.
- */
 static int
 use_builtin_flow(PGconn *conn, fe_oauth_state *state, PGoauthBearerRequestV2 *request)
 {
+#if !defined(USE_LIBCURL)
+	return 0;
+#elif defined(USE_DYNAMIC_OAUTH)
+	/*
+	 * Load the libpq-oauth plugin via dlopen(), initialize it, and plug its
+	 * callbacks into the connection's async auth handlers.
+	 *
+	 * Failure to load here results in a relatively quiet connection error, to
+	 * handle the use case where the build supports loading a flow but a user
+	 * does not want to install it. Troubleshooting of linker/loader failures
+	 * can be done via PGOAUTHDEBUG.
+	 *
+	 * The lifetime of *request ends shortly after this call, so it must be
+	 * copied to longer-lived storage.
+	 */
 	static bool initialized = false;
 	static pthread_mutex_t init_mutex = PTHREAD_MUTEX_INITIALIZER;
 	int			lockerr;
@@ -976,24 +977,10 @@ use_builtin_flow(PGconn *conn, fe_oauth_state *state, PGoauthBearerRequestV2 *re
 	}
 
 	return (start_flow(conn, request) == 0) ? 1 : -1;
-}
-
 #else
-
-/*
- * For static builds, we can just call pg_start_oauthbearer() directly. It's
- * provided by libpq-oauth.a.
- */
-
-extern int	pg_start_oauthbearer(PGconn *conn, PGoauthBearerRequestV2 *request);
-
-static int
-use_builtin_flow(PGconn *conn, fe_oauth_state *state, PGoauthBearerRequestV2 *request)
-{
 	return (pg_start_oauthbearer(conn, request) == 0) ? 1 : -1;
-}
-
 #endif							/* USE_LIBCURL */
+}
 
 
 /*
-- 
2.53.0


--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
 filename=v1-0002-Collapse-SH_CREATE-into-a-single-definition.patch



^ permalink  raw  reply  [nested|flat] 57+ messages in thread

* [PATCH v1 1/2] libpq-oauth: collapse use_builtin_flow() into a single definition
@ 2026-07-01 10:31 Jonathan Gonzalez V. <[email protected]>
  0 siblings, 0 replies; 57+ messages in thread

From: Jonathan Gonzalez V. @ 2026-07-01 10:31 UTC (permalink / raw)

There was three separated definition of the function making lcov v2.x fail
with an error.
---
 src/interfaces/libpq/fe-auth-oauth.c | 61 +++++++++++-----------------
 1 file changed, 24 insertions(+), 37 deletions(-)

diff --git a/src/interfaces/libpq/fe-auth-oauth.c b/src/interfaces/libpq/fe-auth-oauth.c
index 826f7461cb3..7a35647feb8 100644
--- a/src/interfaces/libpq/fe-auth-oauth.c
+++ b/src/interfaces/libpq/fe-auth-oauth.c
@@ -833,41 +833,42 @@ cleanup_oauth_flow(PGconn *conn)
  * failure, and positive indicates success.
  */
 
-#if !defined(USE_LIBCURL)
+#if defined(USE_LIBCURL) && defined(USE_DYNAMIC_OAUTH)
 
 /*
- * This configuration doesn't support the builtin flow.
+ * Use the builtin flow in the libpq-oauth plugin, which is loaded at runtime.
  */
 
-static int
-use_builtin_flow(PGconn *conn, fe_oauth_state *state, PGoauthBearerRequestV2 *request)
-{
-	return 0;
-}
+typedef char *(*libpq_gettext_func) (const char *msgid);
 
-#elif defined(USE_DYNAMIC_OAUTH)
+#elif defined(USE_LIBCURL)
 
 /*
- * Use the builtin flow in the libpq-oauth plugin, which is loaded at runtime.
+ * For static builds, we can just call pg_start_oauthbearer() directly. It's
+ * provided by libpq-oauth.a.
  */
+extern int	pg_start_oauthbearer(PGconn *conn, PGoauthBearerRequestV2 *request);
 
-typedef char *(*libpq_gettext_func) (const char *msgid);
+#endif
 
-/*
- * Loads the libpq-oauth plugin via dlopen(), initializes it, and plugs its
- * callbacks into the connection's async auth handlers.
- *
- * Failure to load here results in a relatively quiet connection error, to
- * handle the use case where the build supports loading a flow but a user does
- * not want to install it. Troubleshooting of linker/loader failures can be done
- * via PGOAUTHDEBUG.
- *
- * The lifetime of *request ends shortly after this call, so it must be copied
- * to longer-lived storage.
- */
 static int
 use_builtin_flow(PGconn *conn, fe_oauth_state *state, PGoauthBearerRequestV2 *request)
 {
+#if !defined(USE_LIBCURL)
+	return 0;
+#elif defined(USE_DYNAMIC_OAUTH)
+	/*
+	 * Load the libpq-oauth plugin via dlopen(), initialize it, and plug its
+	 * callbacks into the connection's async auth handlers.
+	 *
+	 * Failure to load here results in a relatively quiet connection error, to
+	 * handle the use case where the build supports loading a flow but a user
+	 * does not want to install it. Troubleshooting of linker/loader failures
+	 * can be done via PGOAUTHDEBUG.
+	 *
+	 * The lifetime of *request ends shortly after this call, so it must be
+	 * copied to longer-lived storage.
+	 */
 	static bool initialized = false;
 	static pthread_mutex_t init_mutex = PTHREAD_MUTEX_INITIALIZER;
 	int			lockerr;
@@ -976,24 +977,10 @@ use_builtin_flow(PGconn *conn, fe_oauth_state *state, PGoauthBearerRequestV2 *re
 	}
 
 	return (start_flow(conn, request) == 0) ? 1 : -1;
-}
-
 #else
-
-/*
- * For static builds, we can just call pg_start_oauthbearer() directly. It's
- * provided by libpq-oauth.a.
- */
-
-extern int	pg_start_oauthbearer(PGconn *conn, PGoauthBearerRequestV2 *request);
-
-static int
-use_builtin_flow(PGconn *conn, fe_oauth_state *state, PGoauthBearerRequestV2 *request)
-{
 	return (pg_start_oauthbearer(conn, request) == 0) ? 1 : -1;
-}
-
 #endif							/* USE_LIBCURL */
+}
 
 
 /*
-- 
2.53.0


--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
 filename=v1-0002-Collapse-SH_CREATE-into-a-single-definition.patch



^ permalink  raw  reply  [nested|flat] 57+ messages in thread

* [PATCH v1 1/2] libpq-oauth: collapse use_builtin_flow() into a single definition
@ 2026-07-01 10:31 Jonathan Gonzalez V. <[email protected]>
  0 siblings, 0 replies; 57+ messages in thread

From: Jonathan Gonzalez V. @ 2026-07-01 10:31 UTC (permalink / raw)

There was three separated definition of the function making lcov v2.x fail
with an error.
---
 src/interfaces/libpq/fe-auth-oauth.c | 61 +++++++++++-----------------
 1 file changed, 24 insertions(+), 37 deletions(-)

diff --git a/src/interfaces/libpq/fe-auth-oauth.c b/src/interfaces/libpq/fe-auth-oauth.c
index 826f7461cb3..7a35647feb8 100644
--- a/src/interfaces/libpq/fe-auth-oauth.c
+++ b/src/interfaces/libpq/fe-auth-oauth.c
@@ -833,41 +833,42 @@ cleanup_oauth_flow(PGconn *conn)
  * failure, and positive indicates success.
  */
 
-#if !defined(USE_LIBCURL)
+#if defined(USE_LIBCURL) && defined(USE_DYNAMIC_OAUTH)
 
 /*
- * This configuration doesn't support the builtin flow.
+ * Use the builtin flow in the libpq-oauth plugin, which is loaded at runtime.
  */
 
-static int
-use_builtin_flow(PGconn *conn, fe_oauth_state *state, PGoauthBearerRequestV2 *request)
-{
-	return 0;
-}
+typedef char *(*libpq_gettext_func) (const char *msgid);
 
-#elif defined(USE_DYNAMIC_OAUTH)
+#elif defined(USE_LIBCURL)
 
 /*
- * Use the builtin flow in the libpq-oauth plugin, which is loaded at runtime.
+ * For static builds, we can just call pg_start_oauthbearer() directly. It's
+ * provided by libpq-oauth.a.
  */
+extern int	pg_start_oauthbearer(PGconn *conn, PGoauthBearerRequestV2 *request);
 
-typedef char *(*libpq_gettext_func) (const char *msgid);
+#endif
 
-/*
- * Loads the libpq-oauth plugin via dlopen(), initializes it, and plugs its
- * callbacks into the connection's async auth handlers.
- *
- * Failure to load here results in a relatively quiet connection error, to
- * handle the use case where the build supports loading a flow but a user does
- * not want to install it. Troubleshooting of linker/loader failures can be done
- * via PGOAUTHDEBUG.
- *
- * The lifetime of *request ends shortly after this call, so it must be copied
- * to longer-lived storage.
- */
 static int
 use_builtin_flow(PGconn *conn, fe_oauth_state *state, PGoauthBearerRequestV2 *request)
 {
+#if !defined(USE_LIBCURL)
+	return 0;
+#elif defined(USE_DYNAMIC_OAUTH)
+	/*
+	 * Load the libpq-oauth plugin via dlopen(), initialize it, and plug its
+	 * callbacks into the connection's async auth handlers.
+	 *
+	 * Failure to load here results in a relatively quiet connection error, to
+	 * handle the use case where the build supports loading a flow but a user
+	 * does not want to install it. Troubleshooting of linker/loader failures
+	 * can be done via PGOAUTHDEBUG.
+	 *
+	 * The lifetime of *request ends shortly after this call, so it must be
+	 * copied to longer-lived storage.
+	 */
 	static bool initialized = false;
 	static pthread_mutex_t init_mutex = PTHREAD_MUTEX_INITIALIZER;
 	int			lockerr;
@@ -976,24 +977,10 @@ use_builtin_flow(PGconn *conn, fe_oauth_state *state, PGoauthBearerRequestV2 *re
 	}
 
 	return (start_flow(conn, request) == 0) ? 1 : -1;
-}
-
 #else
-
-/*
- * For static builds, we can just call pg_start_oauthbearer() directly. It's
- * provided by libpq-oauth.a.
- */
-
-extern int	pg_start_oauthbearer(PGconn *conn, PGoauthBearerRequestV2 *request);
-
-static int
-use_builtin_flow(PGconn *conn, fe_oauth_state *state, PGoauthBearerRequestV2 *request)
-{
 	return (pg_start_oauthbearer(conn, request) == 0) ? 1 : -1;
-}
-
 #endif							/* USE_LIBCURL */
+}
 
 
 /*
-- 
2.53.0


--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
 filename=v1-0002-Collapse-SH_CREATE-into-a-single-definition.patch



^ permalink  raw  reply  [nested|flat] 57+ messages in thread

* [PATCH v1 1/2] libpq-oauth: collapse use_builtin_flow() into a single definition
@ 2026-07-01 10:31 Jonathan Gonzalez V. <[email protected]>
  0 siblings, 0 replies; 57+ messages in thread

From: Jonathan Gonzalez V. @ 2026-07-01 10:31 UTC (permalink / raw)

There was three separated definition of the function making lcov v2.x fail
with an error.
---
 src/interfaces/libpq/fe-auth-oauth.c | 61 +++++++++++-----------------
 1 file changed, 24 insertions(+), 37 deletions(-)

diff --git a/src/interfaces/libpq/fe-auth-oauth.c b/src/interfaces/libpq/fe-auth-oauth.c
index 826f7461cb3..7a35647feb8 100644
--- a/src/interfaces/libpq/fe-auth-oauth.c
+++ b/src/interfaces/libpq/fe-auth-oauth.c
@@ -833,41 +833,42 @@ cleanup_oauth_flow(PGconn *conn)
  * failure, and positive indicates success.
  */
 
-#if !defined(USE_LIBCURL)
+#if defined(USE_LIBCURL) && defined(USE_DYNAMIC_OAUTH)
 
 /*
- * This configuration doesn't support the builtin flow.
+ * Use the builtin flow in the libpq-oauth plugin, which is loaded at runtime.
  */
 
-static int
-use_builtin_flow(PGconn *conn, fe_oauth_state *state, PGoauthBearerRequestV2 *request)
-{
-	return 0;
-}
+typedef char *(*libpq_gettext_func) (const char *msgid);
 
-#elif defined(USE_DYNAMIC_OAUTH)
+#elif defined(USE_LIBCURL)
 
 /*
- * Use the builtin flow in the libpq-oauth plugin, which is loaded at runtime.
+ * For static builds, we can just call pg_start_oauthbearer() directly. It's
+ * provided by libpq-oauth.a.
  */
+extern int	pg_start_oauthbearer(PGconn *conn, PGoauthBearerRequestV2 *request);
 
-typedef char *(*libpq_gettext_func) (const char *msgid);
+#endif
 
-/*
- * Loads the libpq-oauth plugin via dlopen(), initializes it, and plugs its
- * callbacks into the connection's async auth handlers.
- *
- * Failure to load here results in a relatively quiet connection error, to
- * handle the use case where the build supports loading a flow but a user does
- * not want to install it. Troubleshooting of linker/loader failures can be done
- * via PGOAUTHDEBUG.
- *
- * The lifetime of *request ends shortly after this call, so it must be copied
- * to longer-lived storage.
- */
 static int
 use_builtin_flow(PGconn *conn, fe_oauth_state *state, PGoauthBearerRequestV2 *request)
 {
+#if !defined(USE_LIBCURL)
+	return 0;
+#elif defined(USE_DYNAMIC_OAUTH)
+	/*
+	 * Load the libpq-oauth plugin via dlopen(), initialize it, and plug its
+	 * callbacks into the connection's async auth handlers.
+	 *
+	 * Failure to load here results in a relatively quiet connection error, to
+	 * handle the use case where the build supports loading a flow but a user
+	 * does not want to install it. Troubleshooting of linker/loader failures
+	 * can be done via PGOAUTHDEBUG.
+	 *
+	 * The lifetime of *request ends shortly after this call, so it must be
+	 * copied to longer-lived storage.
+	 */
 	static bool initialized = false;
 	static pthread_mutex_t init_mutex = PTHREAD_MUTEX_INITIALIZER;
 	int			lockerr;
@@ -976,24 +977,10 @@ use_builtin_flow(PGconn *conn, fe_oauth_state *state, PGoauthBearerRequestV2 *re
 	}
 
 	return (start_flow(conn, request) == 0) ? 1 : -1;
-}
-
 #else
-
-/*
- * For static builds, we can just call pg_start_oauthbearer() directly. It's
- * provided by libpq-oauth.a.
- */
-
-extern int	pg_start_oauthbearer(PGconn *conn, PGoauthBearerRequestV2 *request);
-
-static int
-use_builtin_flow(PGconn *conn, fe_oauth_state *state, PGoauthBearerRequestV2 *request)
-{
 	return (pg_start_oauthbearer(conn, request) == 0) ? 1 : -1;
-}
-
 #endif							/* USE_LIBCURL */
+}
 
 
 /*
-- 
2.53.0


--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
 filename=v1-0002-Collapse-SH_CREATE-into-a-single-definition.patch



^ permalink  raw  reply  [nested|flat] 57+ messages in thread

* [PATCH v1 1/2] libpq-oauth: collapse use_builtin_flow() into a single definition
@ 2026-07-01 10:31 Jonathan Gonzalez V. <[email protected]>
  0 siblings, 0 replies; 57+ messages in thread

From: Jonathan Gonzalez V. @ 2026-07-01 10:31 UTC (permalink / raw)

There was three separated definition of the function making lcov v2.x fail
with an error.
---
 src/interfaces/libpq/fe-auth-oauth.c | 61 +++++++++++-----------------
 1 file changed, 24 insertions(+), 37 deletions(-)

diff --git a/src/interfaces/libpq/fe-auth-oauth.c b/src/interfaces/libpq/fe-auth-oauth.c
index 826f7461cb3..7a35647feb8 100644
--- a/src/interfaces/libpq/fe-auth-oauth.c
+++ b/src/interfaces/libpq/fe-auth-oauth.c
@@ -833,41 +833,42 @@ cleanup_oauth_flow(PGconn *conn)
  * failure, and positive indicates success.
  */
 
-#if !defined(USE_LIBCURL)
+#if defined(USE_LIBCURL) && defined(USE_DYNAMIC_OAUTH)
 
 /*
- * This configuration doesn't support the builtin flow.
+ * Use the builtin flow in the libpq-oauth plugin, which is loaded at runtime.
  */
 
-static int
-use_builtin_flow(PGconn *conn, fe_oauth_state *state, PGoauthBearerRequestV2 *request)
-{
-	return 0;
-}
+typedef char *(*libpq_gettext_func) (const char *msgid);
 
-#elif defined(USE_DYNAMIC_OAUTH)
+#elif defined(USE_LIBCURL)
 
 /*
- * Use the builtin flow in the libpq-oauth plugin, which is loaded at runtime.
+ * For static builds, we can just call pg_start_oauthbearer() directly. It's
+ * provided by libpq-oauth.a.
  */
+extern int	pg_start_oauthbearer(PGconn *conn, PGoauthBearerRequestV2 *request);
 
-typedef char *(*libpq_gettext_func) (const char *msgid);
+#endif
 
-/*
- * Loads the libpq-oauth plugin via dlopen(), initializes it, and plugs its
- * callbacks into the connection's async auth handlers.
- *
- * Failure to load here results in a relatively quiet connection error, to
- * handle the use case where the build supports loading a flow but a user does
- * not want to install it. Troubleshooting of linker/loader failures can be done
- * via PGOAUTHDEBUG.
- *
- * The lifetime of *request ends shortly after this call, so it must be copied
- * to longer-lived storage.
- */
 static int
 use_builtin_flow(PGconn *conn, fe_oauth_state *state, PGoauthBearerRequestV2 *request)
 {
+#if !defined(USE_LIBCURL)
+	return 0;
+#elif defined(USE_DYNAMIC_OAUTH)
+	/*
+	 * Load the libpq-oauth plugin via dlopen(), initialize it, and plug its
+	 * callbacks into the connection's async auth handlers.
+	 *
+	 * Failure to load here results in a relatively quiet connection error, to
+	 * handle the use case where the build supports loading a flow but a user
+	 * does not want to install it. Troubleshooting of linker/loader failures
+	 * can be done via PGOAUTHDEBUG.
+	 *
+	 * The lifetime of *request ends shortly after this call, so it must be
+	 * copied to longer-lived storage.
+	 */
 	static bool initialized = false;
 	static pthread_mutex_t init_mutex = PTHREAD_MUTEX_INITIALIZER;
 	int			lockerr;
@@ -976,24 +977,10 @@ use_builtin_flow(PGconn *conn, fe_oauth_state *state, PGoauthBearerRequestV2 *re
 	}
 
 	return (start_flow(conn, request) == 0) ? 1 : -1;
-}
-
 #else
-
-/*
- * For static builds, we can just call pg_start_oauthbearer() directly. It's
- * provided by libpq-oauth.a.
- */
-
-extern int	pg_start_oauthbearer(PGconn *conn, PGoauthBearerRequestV2 *request);
-
-static int
-use_builtin_flow(PGconn *conn, fe_oauth_state *state, PGoauthBearerRequestV2 *request)
-{
 	return (pg_start_oauthbearer(conn, request) == 0) ? 1 : -1;
-}
-
 #endif							/* USE_LIBCURL */
+}
 
 
 /*
-- 
2.53.0


--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
 filename=v1-0002-Collapse-SH_CREATE-into-a-single-definition.patch



^ permalink  raw  reply  [nested|flat] 57+ messages in thread

* [PATCH v1 1/2] libpq-oauth: collapse use_builtin_flow() into a single definition
@ 2026-07-01 10:31 Jonathan Gonzalez V. <[email protected]>
  0 siblings, 0 replies; 57+ messages in thread

From: Jonathan Gonzalez V. @ 2026-07-01 10:31 UTC (permalink / raw)

There was three separated definition of the function making lcov v2.x fail
with an error.
---
 src/interfaces/libpq/fe-auth-oauth.c | 61 +++++++++++-----------------
 1 file changed, 24 insertions(+), 37 deletions(-)

diff --git a/src/interfaces/libpq/fe-auth-oauth.c b/src/interfaces/libpq/fe-auth-oauth.c
index 826f7461cb3..7a35647feb8 100644
--- a/src/interfaces/libpq/fe-auth-oauth.c
+++ b/src/interfaces/libpq/fe-auth-oauth.c
@@ -833,41 +833,42 @@ cleanup_oauth_flow(PGconn *conn)
  * failure, and positive indicates success.
  */
 
-#if !defined(USE_LIBCURL)
+#if defined(USE_LIBCURL) && defined(USE_DYNAMIC_OAUTH)
 
 /*
- * This configuration doesn't support the builtin flow.
+ * Use the builtin flow in the libpq-oauth plugin, which is loaded at runtime.
  */
 
-static int
-use_builtin_flow(PGconn *conn, fe_oauth_state *state, PGoauthBearerRequestV2 *request)
-{
-	return 0;
-}
+typedef char *(*libpq_gettext_func) (const char *msgid);
 
-#elif defined(USE_DYNAMIC_OAUTH)
+#elif defined(USE_LIBCURL)
 
 /*
- * Use the builtin flow in the libpq-oauth plugin, which is loaded at runtime.
+ * For static builds, we can just call pg_start_oauthbearer() directly. It's
+ * provided by libpq-oauth.a.
  */
+extern int	pg_start_oauthbearer(PGconn *conn, PGoauthBearerRequestV2 *request);
 
-typedef char *(*libpq_gettext_func) (const char *msgid);
+#endif
 
-/*
- * Loads the libpq-oauth plugin via dlopen(), initializes it, and plugs its
- * callbacks into the connection's async auth handlers.
- *
- * Failure to load here results in a relatively quiet connection error, to
- * handle the use case where the build supports loading a flow but a user does
- * not want to install it. Troubleshooting of linker/loader failures can be done
- * via PGOAUTHDEBUG.
- *
- * The lifetime of *request ends shortly after this call, so it must be copied
- * to longer-lived storage.
- */
 static int
 use_builtin_flow(PGconn *conn, fe_oauth_state *state, PGoauthBearerRequestV2 *request)
 {
+#if !defined(USE_LIBCURL)
+	return 0;
+#elif defined(USE_DYNAMIC_OAUTH)
+	/*
+	 * Load the libpq-oauth plugin via dlopen(), initialize it, and plug its
+	 * callbacks into the connection's async auth handlers.
+	 *
+	 * Failure to load here results in a relatively quiet connection error, to
+	 * handle the use case where the build supports loading a flow but a user
+	 * does not want to install it. Troubleshooting of linker/loader failures
+	 * can be done via PGOAUTHDEBUG.
+	 *
+	 * The lifetime of *request ends shortly after this call, so it must be
+	 * copied to longer-lived storage.
+	 */
 	static bool initialized = false;
 	static pthread_mutex_t init_mutex = PTHREAD_MUTEX_INITIALIZER;
 	int			lockerr;
@@ -976,24 +977,10 @@ use_builtin_flow(PGconn *conn, fe_oauth_state *state, PGoauthBearerRequestV2 *re
 	}
 
 	return (start_flow(conn, request) == 0) ? 1 : -1;
-}
-
 #else
-
-/*
- * For static builds, we can just call pg_start_oauthbearer() directly. It's
- * provided by libpq-oauth.a.
- */
-
-extern int	pg_start_oauthbearer(PGconn *conn, PGoauthBearerRequestV2 *request);
-
-static int
-use_builtin_flow(PGconn *conn, fe_oauth_state *state, PGoauthBearerRequestV2 *request)
-{
 	return (pg_start_oauthbearer(conn, request) == 0) ? 1 : -1;
-}
-
 #endif							/* USE_LIBCURL */
+}
 
 
 /*
-- 
2.53.0


--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
 filename=v1-0002-Collapse-SH_CREATE-into-a-single-definition.patch



^ permalink  raw  reply  [nested|flat] 57+ messages in thread

* [PATCH v1 1/2] libpq-oauth: collapse use_builtin_flow() into a single definition
@ 2026-07-01 10:31 Jonathan Gonzalez V. <[email protected]>
  0 siblings, 0 replies; 57+ messages in thread

From: Jonathan Gonzalez V. @ 2026-07-01 10:31 UTC (permalink / raw)

There was three separated definition of the function making lcov v2.x fail
with an error.
---
 src/interfaces/libpq/fe-auth-oauth.c | 61 +++++++++++-----------------
 1 file changed, 24 insertions(+), 37 deletions(-)

diff --git a/src/interfaces/libpq/fe-auth-oauth.c b/src/interfaces/libpq/fe-auth-oauth.c
index 826f7461cb3..7a35647feb8 100644
--- a/src/interfaces/libpq/fe-auth-oauth.c
+++ b/src/interfaces/libpq/fe-auth-oauth.c
@@ -833,41 +833,42 @@ cleanup_oauth_flow(PGconn *conn)
  * failure, and positive indicates success.
  */
 
-#if !defined(USE_LIBCURL)
+#if defined(USE_LIBCURL) && defined(USE_DYNAMIC_OAUTH)
 
 /*
- * This configuration doesn't support the builtin flow.
+ * Use the builtin flow in the libpq-oauth plugin, which is loaded at runtime.
  */
 
-static int
-use_builtin_flow(PGconn *conn, fe_oauth_state *state, PGoauthBearerRequestV2 *request)
-{
-	return 0;
-}
+typedef char *(*libpq_gettext_func) (const char *msgid);
 
-#elif defined(USE_DYNAMIC_OAUTH)
+#elif defined(USE_LIBCURL)
 
 /*
- * Use the builtin flow in the libpq-oauth plugin, which is loaded at runtime.
+ * For static builds, we can just call pg_start_oauthbearer() directly. It's
+ * provided by libpq-oauth.a.
  */
+extern int	pg_start_oauthbearer(PGconn *conn, PGoauthBearerRequestV2 *request);
 
-typedef char *(*libpq_gettext_func) (const char *msgid);
+#endif
 
-/*
- * Loads the libpq-oauth plugin via dlopen(), initializes it, and plugs its
- * callbacks into the connection's async auth handlers.
- *
- * Failure to load here results in a relatively quiet connection error, to
- * handle the use case where the build supports loading a flow but a user does
- * not want to install it. Troubleshooting of linker/loader failures can be done
- * via PGOAUTHDEBUG.
- *
- * The lifetime of *request ends shortly after this call, so it must be copied
- * to longer-lived storage.
- */
 static int
 use_builtin_flow(PGconn *conn, fe_oauth_state *state, PGoauthBearerRequestV2 *request)
 {
+#if !defined(USE_LIBCURL)
+	return 0;
+#elif defined(USE_DYNAMIC_OAUTH)
+	/*
+	 * Load the libpq-oauth plugin via dlopen(), initialize it, and plug its
+	 * callbacks into the connection's async auth handlers.
+	 *
+	 * Failure to load here results in a relatively quiet connection error, to
+	 * handle the use case where the build supports loading a flow but a user
+	 * does not want to install it. Troubleshooting of linker/loader failures
+	 * can be done via PGOAUTHDEBUG.
+	 *
+	 * The lifetime of *request ends shortly after this call, so it must be
+	 * copied to longer-lived storage.
+	 */
 	static bool initialized = false;
 	static pthread_mutex_t init_mutex = PTHREAD_MUTEX_INITIALIZER;
 	int			lockerr;
@@ -976,24 +977,10 @@ use_builtin_flow(PGconn *conn, fe_oauth_state *state, PGoauthBearerRequestV2 *re
 	}
 
 	return (start_flow(conn, request) == 0) ? 1 : -1;
-}
-
 #else
-
-/*
- * For static builds, we can just call pg_start_oauthbearer() directly. It's
- * provided by libpq-oauth.a.
- */
-
-extern int	pg_start_oauthbearer(PGconn *conn, PGoauthBearerRequestV2 *request);
-
-static int
-use_builtin_flow(PGconn *conn, fe_oauth_state *state, PGoauthBearerRequestV2 *request)
-{
 	return (pg_start_oauthbearer(conn, request) == 0) ? 1 : -1;
-}
-
 #endif							/* USE_LIBCURL */
+}
 
 
 /*
-- 
2.53.0


--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
 filename=v1-0002-Collapse-SH_CREATE-into-a-single-definition.patch



^ permalink  raw  reply  [nested|flat] 57+ messages in thread

* [PATCH v1 1/2] libpq-oauth: collapse use_builtin_flow() into a single definition
@ 2026-07-01 10:31 Jonathan Gonzalez V. <[email protected]>
  0 siblings, 0 replies; 57+ messages in thread

From: Jonathan Gonzalez V. @ 2026-07-01 10:31 UTC (permalink / raw)

There was three separated definition of the function making lcov v2.x fail
with an error.
---
 src/interfaces/libpq/fe-auth-oauth.c | 61 +++++++++++-----------------
 1 file changed, 24 insertions(+), 37 deletions(-)

diff --git a/src/interfaces/libpq/fe-auth-oauth.c b/src/interfaces/libpq/fe-auth-oauth.c
index 826f7461cb3..7a35647feb8 100644
--- a/src/interfaces/libpq/fe-auth-oauth.c
+++ b/src/interfaces/libpq/fe-auth-oauth.c
@@ -833,41 +833,42 @@ cleanup_oauth_flow(PGconn *conn)
  * failure, and positive indicates success.
  */
 
-#if !defined(USE_LIBCURL)
+#if defined(USE_LIBCURL) && defined(USE_DYNAMIC_OAUTH)
 
 /*
- * This configuration doesn't support the builtin flow.
+ * Use the builtin flow in the libpq-oauth plugin, which is loaded at runtime.
  */
 
-static int
-use_builtin_flow(PGconn *conn, fe_oauth_state *state, PGoauthBearerRequestV2 *request)
-{
-	return 0;
-}
+typedef char *(*libpq_gettext_func) (const char *msgid);
 
-#elif defined(USE_DYNAMIC_OAUTH)
+#elif defined(USE_LIBCURL)
 
 /*
- * Use the builtin flow in the libpq-oauth plugin, which is loaded at runtime.
+ * For static builds, we can just call pg_start_oauthbearer() directly. It's
+ * provided by libpq-oauth.a.
  */
+extern int	pg_start_oauthbearer(PGconn *conn, PGoauthBearerRequestV2 *request);
 
-typedef char *(*libpq_gettext_func) (const char *msgid);
+#endif
 
-/*
- * Loads the libpq-oauth plugin via dlopen(), initializes it, and plugs its
- * callbacks into the connection's async auth handlers.
- *
- * Failure to load here results in a relatively quiet connection error, to
- * handle the use case where the build supports loading a flow but a user does
- * not want to install it. Troubleshooting of linker/loader failures can be done
- * via PGOAUTHDEBUG.
- *
- * The lifetime of *request ends shortly after this call, so it must be copied
- * to longer-lived storage.
- */
 static int
 use_builtin_flow(PGconn *conn, fe_oauth_state *state, PGoauthBearerRequestV2 *request)
 {
+#if !defined(USE_LIBCURL)
+	return 0;
+#elif defined(USE_DYNAMIC_OAUTH)
+	/*
+	 * Load the libpq-oauth plugin via dlopen(), initialize it, and plug its
+	 * callbacks into the connection's async auth handlers.
+	 *
+	 * Failure to load here results in a relatively quiet connection error, to
+	 * handle the use case where the build supports loading a flow but a user
+	 * does not want to install it. Troubleshooting of linker/loader failures
+	 * can be done via PGOAUTHDEBUG.
+	 *
+	 * The lifetime of *request ends shortly after this call, so it must be
+	 * copied to longer-lived storage.
+	 */
 	static bool initialized = false;
 	static pthread_mutex_t init_mutex = PTHREAD_MUTEX_INITIALIZER;
 	int			lockerr;
@@ -976,24 +977,10 @@ use_builtin_flow(PGconn *conn, fe_oauth_state *state, PGoauthBearerRequestV2 *re
 	}
 
 	return (start_flow(conn, request) == 0) ? 1 : -1;
-}
-
 #else
-
-/*
- * For static builds, we can just call pg_start_oauthbearer() directly. It's
- * provided by libpq-oauth.a.
- */
-
-extern int	pg_start_oauthbearer(PGconn *conn, PGoauthBearerRequestV2 *request);
-
-static int
-use_builtin_flow(PGconn *conn, fe_oauth_state *state, PGoauthBearerRequestV2 *request)
-{
 	return (pg_start_oauthbearer(conn, request) == 0) ? 1 : -1;
-}
-
 #endif							/* USE_LIBCURL */
+}
 
 
 /*
-- 
2.53.0


--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
 filename=v1-0002-Collapse-SH_CREATE-into-a-single-definition.patch



^ permalink  raw  reply  [nested|flat] 57+ messages in thread

* [PATCH v1 1/2] libpq-oauth: collapse use_builtin_flow() into a single definition
@ 2026-07-01 10:31 Jonathan Gonzalez V. <[email protected]>
  0 siblings, 0 replies; 57+ messages in thread

From: Jonathan Gonzalez V. @ 2026-07-01 10:31 UTC (permalink / raw)

There was three separated definition of the function making lcov v2.x fail
with an error.
---
 src/interfaces/libpq/fe-auth-oauth.c | 61 +++++++++++-----------------
 1 file changed, 24 insertions(+), 37 deletions(-)

diff --git a/src/interfaces/libpq/fe-auth-oauth.c b/src/interfaces/libpq/fe-auth-oauth.c
index 826f7461cb3..7a35647feb8 100644
--- a/src/interfaces/libpq/fe-auth-oauth.c
+++ b/src/interfaces/libpq/fe-auth-oauth.c
@@ -833,41 +833,42 @@ cleanup_oauth_flow(PGconn *conn)
  * failure, and positive indicates success.
  */
 
-#if !defined(USE_LIBCURL)
+#if defined(USE_LIBCURL) && defined(USE_DYNAMIC_OAUTH)
 
 /*
- * This configuration doesn't support the builtin flow.
+ * Use the builtin flow in the libpq-oauth plugin, which is loaded at runtime.
  */
 
-static int
-use_builtin_flow(PGconn *conn, fe_oauth_state *state, PGoauthBearerRequestV2 *request)
-{
-	return 0;
-}
+typedef char *(*libpq_gettext_func) (const char *msgid);
 
-#elif defined(USE_DYNAMIC_OAUTH)
+#elif defined(USE_LIBCURL)
 
 /*
- * Use the builtin flow in the libpq-oauth plugin, which is loaded at runtime.
+ * For static builds, we can just call pg_start_oauthbearer() directly. It's
+ * provided by libpq-oauth.a.
  */
+extern int	pg_start_oauthbearer(PGconn *conn, PGoauthBearerRequestV2 *request);
 
-typedef char *(*libpq_gettext_func) (const char *msgid);
+#endif
 
-/*
- * Loads the libpq-oauth plugin via dlopen(), initializes it, and plugs its
- * callbacks into the connection's async auth handlers.
- *
- * Failure to load here results in a relatively quiet connection error, to
- * handle the use case where the build supports loading a flow but a user does
- * not want to install it. Troubleshooting of linker/loader failures can be done
- * via PGOAUTHDEBUG.
- *
- * The lifetime of *request ends shortly after this call, so it must be copied
- * to longer-lived storage.
- */
 static int
 use_builtin_flow(PGconn *conn, fe_oauth_state *state, PGoauthBearerRequestV2 *request)
 {
+#if !defined(USE_LIBCURL)
+	return 0;
+#elif defined(USE_DYNAMIC_OAUTH)
+	/*
+	 * Load the libpq-oauth plugin via dlopen(), initialize it, and plug its
+	 * callbacks into the connection's async auth handlers.
+	 *
+	 * Failure to load here results in a relatively quiet connection error, to
+	 * handle the use case where the build supports loading a flow but a user
+	 * does not want to install it. Troubleshooting of linker/loader failures
+	 * can be done via PGOAUTHDEBUG.
+	 *
+	 * The lifetime of *request ends shortly after this call, so it must be
+	 * copied to longer-lived storage.
+	 */
 	static bool initialized = false;
 	static pthread_mutex_t init_mutex = PTHREAD_MUTEX_INITIALIZER;
 	int			lockerr;
@@ -976,24 +977,10 @@ use_builtin_flow(PGconn *conn, fe_oauth_state *state, PGoauthBearerRequestV2 *re
 	}
 
 	return (start_flow(conn, request) == 0) ? 1 : -1;
-}
-
 #else
-
-/*
- * For static builds, we can just call pg_start_oauthbearer() directly. It's
- * provided by libpq-oauth.a.
- */
-
-extern int	pg_start_oauthbearer(PGconn *conn, PGoauthBearerRequestV2 *request);
-
-static int
-use_builtin_flow(PGconn *conn, fe_oauth_state *state, PGoauthBearerRequestV2 *request)
-{
 	return (pg_start_oauthbearer(conn, request) == 0) ? 1 : -1;
-}
-
 #endif							/* USE_LIBCURL */
+}
 
 
 /*
-- 
2.53.0


--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
 filename=v1-0002-Collapse-SH_CREATE-into-a-single-definition.patch



^ permalink  raw  reply  [nested|flat] 57+ messages in thread

* [PATCH v1 1/2] libpq-oauth: collapse use_builtin_flow() into a single definition
@ 2026-07-01 10:31 Jonathan Gonzalez V. <[email protected]>
  0 siblings, 0 replies; 57+ messages in thread

From: Jonathan Gonzalez V. @ 2026-07-01 10:31 UTC (permalink / raw)

There was three separated definition of the function making lcov v2.x fail
with an error.
---
 src/interfaces/libpq/fe-auth-oauth.c | 61 +++++++++++-----------------
 1 file changed, 24 insertions(+), 37 deletions(-)

diff --git a/src/interfaces/libpq/fe-auth-oauth.c b/src/interfaces/libpq/fe-auth-oauth.c
index 826f7461cb3..7a35647feb8 100644
--- a/src/interfaces/libpq/fe-auth-oauth.c
+++ b/src/interfaces/libpq/fe-auth-oauth.c
@@ -833,41 +833,42 @@ cleanup_oauth_flow(PGconn *conn)
  * failure, and positive indicates success.
  */
 
-#if !defined(USE_LIBCURL)
+#if defined(USE_LIBCURL) && defined(USE_DYNAMIC_OAUTH)
 
 /*
- * This configuration doesn't support the builtin flow.
+ * Use the builtin flow in the libpq-oauth plugin, which is loaded at runtime.
  */
 
-static int
-use_builtin_flow(PGconn *conn, fe_oauth_state *state, PGoauthBearerRequestV2 *request)
-{
-	return 0;
-}
+typedef char *(*libpq_gettext_func) (const char *msgid);
 
-#elif defined(USE_DYNAMIC_OAUTH)
+#elif defined(USE_LIBCURL)
 
 /*
- * Use the builtin flow in the libpq-oauth plugin, which is loaded at runtime.
+ * For static builds, we can just call pg_start_oauthbearer() directly. It's
+ * provided by libpq-oauth.a.
  */
+extern int	pg_start_oauthbearer(PGconn *conn, PGoauthBearerRequestV2 *request);
 
-typedef char *(*libpq_gettext_func) (const char *msgid);
+#endif
 
-/*
- * Loads the libpq-oauth plugin via dlopen(), initializes it, and plugs its
- * callbacks into the connection's async auth handlers.
- *
- * Failure to load here results in a relatively quiet connection error, to
- * handle the use case where the build supports loading a flow but a user does
- * not want to install it. Troubleshooting of linker/loader failures can be done
- * via PGOAUTHDEBUG.
- *
- * The lifetime of *request ends shortly after this call, so it must be copied
- * to longer-lived storage.
- */
 static int
 use_builtin_flow(PGconn *conn, fe_oauth_state *state, PGoauthBearerRequestV2 *request)
 {
+#if !defined(USE_LIBCURL)
+	return 0;
+#elif defined(USE_DYNAMIC_OAUTH)
+	/*
+	 * Load the libpq-oauth plugin via dlopen(), initialize it, and plug its
+	 * callbacks into the connection's async auth handlers.
+	 *
+	 * Failure to load here results in a relatively quiet connection error, to
+	 * handle the use case where the build supports loading a flow but a user
+	 * does not want to install it. Troubleshooting of linker/loader failures
+	 * can be done via PGOAUTHDEBUG.
+	 *
+	 * The lifetime of *request ends shortly after this call, so it must be
+	 * copied to longer-lived storage.
+	 */
 	static bool initialized = false;
 	static pthread_mutex_t init_mutex = PTHREAD_MUTEX_INITIALIZER;
 	int			lockerr;
@@ -976,24 +977,10 @@ use_builtin_flow(PGconn *conn, fe_oauth_state *state, PGoauthBearerRequestV2 *re
 	}
 
 	return (start_flow(conn, request) == 0) ? 1 : -1;
-}
-
 #else
-
-/*
- * For static builds, we can just call pg_start_oauthbearer() directly. It's
- * provided by libpq-oauth.a.
- */
-
-extern int	pg_start_oauthbearer(PGconn *conn, PGoauthBearerRequestV2 *request);
-
-static int
-use_builtin_flow(PGconn *conn, fe_oauth_state *state, PGoauthBearerRequestV2 *request)
-{
 	return (pg_start_oauthbearer(conn, request) == 0) ? 1 : -1;
-}
-
 #endif							/* USE_LIBCURL */
+}
 
 
 /*
-- 
2.53.0


--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
 filename=v1-0002-Collapse-SH_CREATE-into-a-single-definition.patch



^ permalink  raw  reply  [nested|flat] 57+ messages in thread

* [PATCH v1 1/2] libpq-oauth: collapse use_builtin_flow() into a single definition
@ 2026-07-01 10:31 Jonathan Gonzalez V. <[email protected]>
  0 siblings, 0 replies; 57+ messages in thread

From: Jonathan Gonzalez V. @ 2026-07-01 10:31 UTC (permalink / raw)

There was three separated definition of the function making lcov v2.x fail
with an error.
---
 src/interfaces/libpq/fe-auth-oauth.c | 61 +++++++++++-----------------
 1 file changed, 24 insertions(+), 37 deletions(-)

diff --git a/src/interfaces/libpq/fe-auth-oauth.c b/src/interfaces/libpq/fe-auth-oauth.c
index 826f7461cb3..7a35647feb8 100644
--- a/src/interfaces/libpq/fe-auth-oauth.c
+++ b/src/interfaces/libpq/fe-auth-oauth.c
@@ -833,41 +833,42 @@ cleanup_oauth_flow(PGconn *conn)
  * failure, and positive indicates success.
  */
 
-#if !defined(USE_LIBCURL)
+#if defined(USE_LIBCURL) && defined(USE_DYNAMIC_OAUTH)
 
 /*
- * This configuration doesn't support the builtin flow.
+ * Use the builtin flow in the libpq-oauth plugin, which is loaded at runtime.
  */
 
-static int
-use_builtin_flow(PGconn *conn, fe_oauth_state *state, PGoauthBearerRequestV2 *request)
-{
-	return 0;
-}
+typedef char *(*libpq_gettext_func) (const char *msgid);
 
-#elif defined(USE_DYNAMIC_OAUTH)
+#elif defined(USE_LIBCURL)
 
 /*
- * Use the builtin flow in the libpq-oauth plugin, which is loaded at runtime.
+ * For static builds, we can just call pg_start_oauthbearer() directly. It's
+ * provided by libpq-oauth.a.
  */
+extern int	pg_start_oauthbearer(PGconn *conn, PGoauthBearerRequestV2 *request);
 
-typedef char *(*libpq_gettext_func) (const char *msgid);
+#endif
 
-/*
- * Loads the libpq-oauth plugin via dlopen(), initializes it, and plugs its
- * callbacks into the connection's async auth handlers.
- *
- * Failure to load here results in a relatively quiet connection error, to
- * handle the use case where the build supports loading a flow but a user does
- * not want to install it. Troubleshooting of linker/loader failures can be done
- * via PGOAUTHDEBUG.
- *
- * The lifetime of *request ends shortly after this call, so it must be copied
- * to longer-lived storage.
- */
 static int
 use_builtin_flow(PGconn *conn, fe_oauth_state *state, PGoauthBearerRequestV2 *request)
 {
+#if !defined(USE_LIBCURL)
+	return 0;
+#elif defined(USE_DYNAMIC_OAUTH)
+	/*
+	 * Load the libpq-oauth plugin via dlopen(), initialize it, and plug its
+	 * callbacks into the connection's async auth handlers.
+	 *
+	 * Failure to load here results in a relatively quiet connection error, to
+	 * handle the use case where the build supports loading a flow but a user
+	 * does not want to install it. Troubleshooting of linker/loader failures
+	 * can be done via PGOAUTHDEBUG.
+	 *
+	 * The lifetime of *request ends shortly after this call, so it must be
+	 * copied to longer-lived storage.
+	 */
 	static bool initialized = false;
 	static pthread_mutex_t init_mutex = PTHREAD_MUTEX_INITIALIZER;
 	int			lockerr;
@@ -976,24 +977,10 @@ use_builtin_flow(PGconn *conn, fe_oauth_state *state, PGoauthBearerRequestV2 *re
 	}
 
 	return (start_flow(conn, request) == 0) ? 1 : -1;
-}
-
 #else
-
-/*
- * For static builds, we can just call pg_start_oauthbearer() directly. It's
- * provided by libpq-oauth.a.
- */
-
-extern int	pg_start_oauthbearer(PGconn *conn, PGoauthBearerRequestV2 *request);
-
-static int
-use_builtin_flow(PGconn *conn, fe_oauth_state *state, PGoauthBearerRequestV2 *request)
-{
 	return (pg_start_oauthbearer(conn, request) == 0) ? 1 : -1;
-}
-
 #endif							/* USE_LIBCURL */
+}
 
 
 /*
-- 
2.53.0


--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
 filename=v1-0002-Collapse-SH_CREATE-into-a-single-definition.patch



^ permalink  raw  reply  [nested|flat] 57+ messages in thread

* [PATCH v1 1/2] libpq-oauth: collapse use_builtin_flow() into a single definition
@ 2026-07-01 10:31 Jonathan Gonzalez V. <[email protected]>
  0 siblings, 0 replies; 57+ messages in thread

From: Jonathan Gonzalez V. @ 2026-07-01 10:31 UTC (permalink / raw)

There was three separated definition of the function making lcov v2.x fail
with an error.
---
 src/interfaces/libpq/fe-auth-oauth.c | 61 +++++++++++-----------------
 1 file changed, 24 insertions(+), 37 deletions(-)

diff --git a/src/interfaces/libpq/fe-auth-oauth.c b/src/interfaces/libpq/fe-auth-oauth.c
index 826f7461cb3..7a35647feb8 100644
--- a/src/interfaces/libpq/fe-auth-oauth.c
+++ b/src/interfaces/libpq/fe-auth-oauth.c
@@ -833,41 +833,42 @@ cleanup_oauth_flow(PGconn *conn)
  * failure, and positive indicates success.
  */
 
-#if !defined(USE_LIBCURL)
+#if defined(USE_LIBCURL) && defined(USE_DYNAMIC_OAUTH)
 
 /*
- * This configuration doesn't support the builtin flow.
+ * Use the builtin flow in the libpq-oauth plugin, which is loaded at runtime.
  */
 
-static int
-use_builtin_flow(PGconn *conn, fe_oauth_state *state, PGoauthBearerRequestV2 *request)
-{
-	return 0;
-}
+typedef char *(*libpq_gettext_func) (const char *msgid);
 
-#elif defined(USE_DYNAMIC_OAUTH)
+#elif defined(USE_LIBCURL)
 
 /*
- * Use the builtin flow in the libpq-oauth plugin, which is loaded at runtime.
+ * For static builds, we can just call pg_start_oauthbearer() directly. It's
+ * provided by libpq-oauth.a.
  */
+extern int	pg_start_oauthbearer(PGconn *conn, PGoauthBearerRequestV2 *request);
 
-typedef char *(*libpq_gettext_func) (const char *msgid);
+#endif
 
-/*
- * Loads the libpq-oauth plugin via dlopen(), initializes it, and plugs its
- * callbacks into the connection's async auth handlers.
- *
- * Failure to load here results in a relatively quiet connection error, to
- * handle the use case where the build supports loading a flow but a user does
- * not want to install it. Troubleshooting of linker/loader failures can be done
- * via PGOAUTHDEBUG.
- *
- * The lifetime of *request ends shortly after this call, so it must be copied
- * to longer-lived storage.
- */
 static int
 use_builtin_flow(PGconn *conn, fe_oauth_state *state, PGoauthBearerRequestV2 *request)
 {
+#if !defined(USE_LIBCURL)
+	return 0;
+#elif defined(USE_DYNAMIC_OAUTH)
+	/*
+	 * Load the libpq-oauth plugin via dlopen(), initialize it, and plug its
+	 * callbacks into the connection's async auth handlers.
+	 *
+	 * Failure to load here results in a relatively quiet connection error, to
+	 * handle the use case where the build supports loading a flow but a user
+	 * does not want to install it. Troubleshooting of linker/loader failures
+	 * can be done via PGOAUTHDEBUG.
+	 *
+	 * The lifetime of *request ends shortly after this call, so it must be
+	 * copied to longer-lived storage.
+	 */
 	static bool initialized = false;
 	static pthread_mutex_t init_mutex = PTHREAD_MUTEX_INITIALIZER;
 	int			lockerr;
@@ -976,24 +977,10 @@ use_builtin_flow(PGconn *conn, fe_oauth_state *state, PGoauthBearerRequestV2 *re
 	}
 
 	return (start_flow(conn, request) == 0) ? 1 : -1;
-}
-
 #else
-
-/*
- * For static builds, we can just call pg_start_oauthbearer() directly. It's
- * provided by libpq-oauth.a.
- */
-
-extern int	pg_start_oauthbearer(PGconn *conn, PGoauthBearerRequestV2 *request);
-
-static int
-use_builtin_flow(PGconn *conn, fe_oauth_state *state, PGoauthBearerRequestV2 *request)
-{
 	return (pg_start_oauthbearer(conn, request) == 0) ? 1 : -1;
-}
-
 #endif							/* USE_LIBCURL */
+}
 
 
 /*
-- 
2.53.0


--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
 filename=v1-0002-Collapse-SH_CREATE-into-a-single-definition.patch



^ permalink  raw  reply  [nested|flat] 57+ messages in thread

* [PATCH v1 1/2] libpq-oauth: collapse use_builtin_flow() into a single definition
@ 2026-07-01 10:31 Jonathan Gonzalez V. <[email protected]>
  0 siblings, 0 replies; 57+ messages in thread

From: Jonathan Gonzalez V. @ 2026-07-01 10:31 UTC (permalink / raw)

There was three separated definition of the function making lcov v2.x fail
with an error.
---
 src/interfaces/libpq/fe-auth-oauth.c | 61 +++++++++++-----------------
 1 file changed, 24 insertions(+), 37 deletions(-)

diff --git a/src/interfaces/libpq/fe-auth-oauth.c b/src/interfaces/libpq/fe-auth-oauth.c
index 826f7461cb3..7a35647feb8 100644
--- a/src/interfaces/libpq/fe-auth-oauth.c
+++ b/src/interfaces/libpq/fe-auth-oauth.c
@@ -833,41 +833,42 @@ cleanup_oauth_flow(PGconn *conn)
  * failure, and positive indicates success.
  */
 
-#if !defined(USE_LIBCURL)
+#if defined(USE_LIBCURL) && defined(USE_DYNAMIC_OAUTH)
 
 /*
- * This configuration doesn't support the builtin flow.
+ * Use the builtin flow in the libpq-oauth plugin, which is loaded at runtime.
  */
 
-static int
-use_builtin_flow(PGconn *conn, fe_oauth_state *state, PGoauthBearerRequestV2 *request)
-{
-	return 0;
-}
+typedef char *(*libpq_gettext_func) (const char *msgid);
 
-#elif defined(USE_DYNAMIC_OAUTH)
+#elif defined(USE_LIBCURL)
 
 /*
- * Use the builtin flow in the libpq-oauth plugin, which is loaded at runtime.
+ * For static builds, we can just call pg_start_oauthbearer() directly. It's
+ * provided by libpq-oauth.a.
  */
+extern int	pg_start_oauthbearer(PGconn *conn, PGoauthBearerRequestV2 *request);
 
-typedef char *(*libpq_gettext_func) (const char *msgid);
+#endif
 
-/*
- * Loads the libpq-oauth plugin via dlopen(), initializes it, and plugs its
- * callbacks into the connection's async auth handlers.
- *
- * Failure to load here results in a relatively quiet connection error, to
- * handle the use case where the build supports loading a flow but a user does
- * not want to install it. Troubleshooting of linker/loader failures can be done
- * via PGOAUTHDEBUG.
- *
- * The lifetime of *request ends shortly after this call, so it must be copied
- * to longer-lived storage.
- */
 static int
 use_builtin_flow(PGconn *conn, fe_oauth_state *state, PGoauthBearerRequestV2 *request)
 {
+#if !defined(USE_LIBCURL)
+	return 0;
+#elif defined(USE_DYNAMIC_OAUTH)
+	/*
+	 * Load the libpq-oauth plugin via dlopen(), initialize it, and plug its
+	 * callbacks into the connection's async auth handlers.
+	 *
+	 * Failure to load here results in a relatively quiet connection error, to
+	 * handle the use case where the build supports loading a flow but a user
+	 * does not want to install it. Troubleshooting of linker/loader failures
+	 * can be done via PGOAUTHDEBUG.
+	 *
+	 * The lifetime of *request ends shortly after this call, so it must be
+	 * copied to longer-lived storage.
+	 */
 	static bool initialized = false;
 	static pthread_mutex_t init_mutex = PTHREAD_MUTEX_INITIALIZER;
 	int			lockerr;
@@ -976,24 +977,10 @@ use_builtin_flow(PGconn *conn, fe_oauth_state *state, PGoauthBearerRequestV2 *re
 	}
 
 	return (start_flow(conn, request) == 0) ? 1 : -1;
-}
-
 #else
-
-/*
- * For static builds, we can just call pg_start_oauthbearer() directly. It's
- * provided by libpq-oauth.a.
- */
-
-extern int	pg_start_oauthbearer(PGconn *conn, PGoauthBearerRequestV2 *request);
-
-static int
-use_builtin_flow(PGconn *conn, fe_oauth_state *state, PGoauthBearerRequestV2 *request)
-{
 	return (pg_start_oauthbearer(conn, request) == 0) ? 1 : -1;
-}
-
 #endif							/* USE_LIBCURL */
+}
 
 
 /*
-- 
2.53.0


--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
 filename=v1-0002-Collapse-SH_CREATE-into-a-single-definition.patch



^ permalink  raw  reply  [nested|flat] 57+ messages in thread

* [PATCH v1 1/2] libpq-oauth: collapse use_builtin_flow() into a single definition
@ 2026-07-01 10:31 Jonathan Gonzalez V. <[email protected]>
  0 siblings, 0 replies; 57+ messages in thread

From: Jonathan Gonzalez V. @ 2026-07-01 10:31 UTC (permalink / raw)

There was three separated definition of the function making lcov v2.x fail
with an error.
---
 src/interfaces/libpq/fe-auth-oauth.c | 61 +++++++++++-----------------
 1 file changed, 24 insertions(+), 37 deletions(-)

diff --git a/src/interfaces/libpq/fe-auth-oauth.c b/src/interfaces/libpq/fe-auth-oauth.c
index 826f7461cb3..7a35647feb8 100644
--- a/src/interfaces/libpq/fe-auth-oauth.c
+++ b/src/interfaces/libpq/fe-auth-oauth.c
@@ -833,41 +833,42 @@ cleanup_oauth_flow(PGconn *conn)
  * failure, and positive indicates success.
  */
 
-#if !defined(USE_LIBCURL)
+#if defined(USE_LIBCURL) && defined(USE_DYNAMIC_OAUTH)
 
 /*
- * This configuration doesn't support the builtin flow.
+ * Use the builtin flow in the libpq-oauth plugin, which is loaded at runtime.
  */
 
-static int
-use_builtin_flow(PGconn *conn, fe_oauth_state *state, PGoauthBearerRequestV2 *request)
-{
-	return 0;
-}
+typedef char *(*libpq_gettext_func) (const char *msgid);
 
-#elif defined(USE_DYNAMIC_OAUTH)
+#elif defined(USE_LIBCURL)
 
 /*
- * Use the builtin flow in the libpq-oauth plugin, which is loaded at runtime.
+ * For static builds, we can just call pg_start_oauthbearer() directly. It's
+ * provided by libpq-oauth.a.
  */
+extern int	pg_start_oauthbearer(PGconn *conn, PGoauthBearerRequestV2 *request);
 
-typedef char *(*libpq_gettext_func) (const char *msgid);
+#endif
 
-/*
- * Loads the libpq-oauth plugin via dlopen(), initializes it, and plugs its
- * callbacks into the connection's async auth handlers.
- *
- * Failure to load here results in a relatively quiet connection error, to
- * handle the use case where the build supports loading a flow but a user does
- * not want to install it. Troubleshooting of linker/loader failures can be done
- * via PGOAUTHDEBUG.
- *
- * The lifetime of *request ends shortly after this call, so it must be copied
- * to longer-lived storage.
- */
 static int
 use_builtin_flow(PGconn *conn, fe_oauth_state *state, PGoauthBearerRequestV2 *request)
 {
+#if !defined(USE_LIBCURL)
+	return 0;
+#elif defined(USE_DYNAMIC_OAUTH)
+	/*
+	 * Load the libpq-oauth plugin via dlopen(), initialize it, and plug its
+	 * callbacks into the connection's async auth handlers.
+	 *
+	 * Failure to load here results in a relatively quiet connection error, to
+	 * handle the use case where the build supports loading a flow but a user
+	 * does not want to install it. Troubleshooting of linker/loader failures
+	 * can be done via PGOAUTHDEBUG.
+	 *
+	 * The lifetime of *request ends shortly after this call, so it must be
+	 * copied to longer-lived storage.
+	 */
 	static bool initialized = false;
 	static pthread_mutex_t init_mutex = PTHREAD_MUTEX_INITIALIZER;
 	int			lockerr;
@@ -976,24 +977,10 @@ use_builtin_flow(PGconn *conn, fe_oauth_state *state, PGoauthBearerRequestV2 *re
 	}
 
 	return (start_flow(conn, request) == 0) ? 1 : -1;
-}
-
 #else
-
-/*
- * For static builds, we can just call pg_start_oauthbearer() directly. It's
- * provided by libpq-oauth.a.
- */
-
-extern int	pg_start_oauthbearer(PGconn *conn, PGoauthBearerRequestV2 *request);
-
-static int
-use_builtin_flow(PGconn *conn, fe_oauth_state *state, PGoauthBearerRequestV2 *request)
-{
 	return (pg_start_oauthbearer(conn, request) == 0) ? 1 : -1;
-}
-
 #endif							/* USE_LIBCURL */
+}
 
 
 /*
-- 
2.53.0


--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
 filename=v1-0002-Collapse-SH_CREATE-into-a-single-definition.patch



^ permalink  raw  reply  [nested|flat] 57+ messages in thread

* [PATCH v1 1/2] libpq-oauth: collapse use_builtin_flow() into a single definition
@ 2026-07-01 10:31 Jonathan Gonzalez V. <[email protected]>
  0 siblings, 0 replies; 57+ messages in thread

From: Jonathan Gonzalez V. @ 2026-07-01 10:31 UTC (permalink / raw)

There was three separated definition of the function making lcov v2.x fail
with an error.
---
 src/interfaces/libpq/fe-auth-oauth.c | 61 +++++++++++-----------------
 1 file changed, 24 insertions(+), 37 deletions(-)

diff --git a/src/interfaces/libpq/fe-auth-oauth.c b/src/interfaces/libpq/fe-auth-oauth.c
index 826f7461cb3..7a35647feb8 100644
--- a/src/interfaces/libpq/fe-auth-oauth.c
+++ b/src/interfaces/libpq/fe-auth-oauth.c
@@ -833,41 +833,42 @@ cleanup_oauth_flow(PGconn *conn)
  * failure, and positive indicates success.
  */
 
-#if !defined(USE_LIBCURL)
+#if defined(USE_LIBCURL) && defined(USE_DYNAMIC_OAUTH)
 
 /*
- * This configuration doesn't support the builtin flow.
+ * Use the builtin flow in the libpq-oauth plugin, which is loaded at runtime.
  */
 
-static int
-use_builtin_flow(PGconn *conn, fe_oauth_state *state, PGoauthBearerRequestV2 *request)
-{
-	return 0;
-}
+typedef char *(*libpq_gettext_func) (const char *msgid);
 
-#elif defined(USE_DYNAMIC_OAUTH)
+#elif defined(USE_LIBCURL)
 
 /*
- * Use the builtin flow in the libpq-oauth plugin, which is loaded at runtime.
+ * For static builds, we can just call pg_start_oauthbearer() directly. It's
+ * provided by libpq-oauth.a.
  */
+extern int	pg_start_oauthbearer(PGconn *conn, PGoauthBearerRequestV2 *request);
 
-typedef char *(*libpq_gettext_func) (const char *msgid);
+#endif
 
-/*
- * Loads the libpq-oauth plugin via dlopen(), initializes it, and plugs its
- * callbacks into the connection's async auth handlers.
- *
- * Failure to load here results in a relatively quiet connection error, to
- * handle the use case where the build supports loading a flow but a user does
- * not want to install it. Troubleshooting of linker/loader failures can be done
- * via PGOAUTHDEBUG.
- *
- * The lifetime of *request ends shortly after this call, so it must be copied
- * to longer-lived storage.
- */
 static int
 use_builtin_flow(PGconn *conn, fe_oauth_state *state, PGoauthBearerRequestV2 *request)
 {
+#if !defined(USE_LIBCURL)
+	return 0;
+#elif defined(USE_DYNAMIC_OAUTH)
+	/*
+	 * Load the libpq-oauth plugin via dlopen(), initialize it, and plug its
+	 * callbacks into the connection's async auth handlers.
+	 *
+	 * Failure to load here results in a relatively quiet connection error, to
+	 * handle the use case where the build supports loading a flow but a user
+	 * does not want to install it. Troubleshooting of linker/loader failures
+	 * can be done via PGOAUTHDEBUG.
+	 *
+	 * The lifetime of *request ends shortly after this call, so it must be
+	 * copied to longer-lived storage.
+	 */
 	static bool initialized = false;
 	static pthread_mutex_t init_mutex = PTHREAD_MUTEX_INITIALIZER;
 	int			lockerr;
@@ -976,24 +977,10 @@ use_builtin_flow(PGconn *conn, fe_oauth_state *state, PGoauthBearerRequestV2 *re
 	}
 
 	return (start_flow(conn, request) == 0) ? 1 : -1;
-}
-
 #else
-
-/*
- * For static builds, we can just call pg_start_oauthbearer() directly. It's
- * provided by libpq-oauth.a.
- */
-
-extern int	pg_start_oauthbearer(PGconn *conn, PGoauthBearerRequestV2 *request);
-
-static int
-use_builtin_flow(PGconn *conn, fe_oauth_state *state, PGoauthBearerRequestV2 *request)
-{
 	return (pg_start_oauthbearer(conn, request) == 0) ? 1 : -1;
-}
-
 #endif							/* USE_LIBCURL */
+}
 
 
 /*
-- 
2.53.0


--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
 filename=v1-0002-Collapse-SH_CREATE-into-a-single-definition.patch



^ permalink  raw  reply  [nested|flat] 57+ messages in thread

* [PATCH v1 1/2] libpq-oauth: collapse use_builtin_flow() into a single definition
@ 2026-07-01 10:31 Jonathan Gonzalez V. <[email protected]>
  0 siblings, 0 replies; 57+ messages in thread

From: Jonathan Gonzalez V. @ 2026-07-01 10:31 UTC (permalink / raw)

There was three separated definition of the function making lcov v2.x fail
with an error.
---
 src/interfaces/libpq/fe-auth-oauth.c | 61 +++++++++++-----------------
 1 file changed, 24 insertions(+), 37 deletions(-)

diff --git a/src/interfaces/libpq/fe-auth-oauth.c b/src/interfaces/libpq/fe-auth-oauth.c
index 826f7461cb3..7a35647feb8 100644
--- a/src/interfaces/libpq/fe-auth-oauth.c
+++ b/src/interfaces/libpq/fe-auth-oauth.c
@@ -833,41 +833,42 @@ cleanup_oauth_flow(PGconn *conn)
  * failure, and positive indicates success.
  */
 
-#if !defined(USE_LIBCURL)
+#if defined(USE_LIBCURL) && defined(USE_DYNAMIC_OAUTH)
 
 /*
- * This configuration doesn't support the builtin flow.
+ * Use the builtin flow in the libpq-oauth plugin, which is loaded at runtime.
  */
 
-static int
-use_builtin_flow(PGconn *conn, fe_oauth_state *state, PGoauthBearerRequestV2 *request)
-{
-	return 0;
-}
+typedef char *(*libpq_gettext_func) (const char *msgid);
 
-#elif defined(USE_DYNAMIC_OAUTH)
+#elif defined(USE_LIBCURL)
 
 /*
- * Use the builtin flow in the libpq-oauth plugin, which is loaded at runtime.
+ * For static builds, we can just call pg_start_oauthbearer() directly. It's
+ * provided by libpq-oauth.a.
  */
+extern int	pg_start_oauthbearer(PGconn *conn, PGoauthBearerRequestV2 *request);
 
-typedef char *(*libpq_gettext_func) (const char *msgid);
+#endif
 
-/*
- * Loads the libpq-oauth plugin via dlopen(), initializes it, and plugs its
- * callbacks into the connection's async auth handlers.
- *
- * Failure to load here results in a relatively quiet connection error, to
- * handle the use case where the build supports loading a flow but a user does
- * not want to install it. Troubleshooting of linker/loader failures can be done
- * via PGOAUTHDEBUG.
- *
- * The lifetime of *request ends shortly after this call, so it must be copied
- * to longer-lived storage.
- */
 static int
 use_builtin_flow(PGconn *conn, fe_oauth_state *state, PGoauthBearerRequestV2 *request)
 {
+#if !defined(USE_LIBCURL)
+	return 0;
+#elif defined(USE_DYNAMIC_OAUTH)
+	/*
+	 * Load the libpq-oauth plugin via dlopen(), initialize it, and plug its
+	 * callbacks into the connection's async auth handlers.
+	 *
+	 * Failure to load here results in a relatively quiet connection error, to
+	 * handle the use case where the build supports loading a flow but a user
+	 * does not want to install it. Troubleshooting of linker/loader failures
+	 * can be done via PGOAUTHDEBUG.
+	 *
+	 * The lifetime of *request ends shortly after this call, so it must be
+	 * copied to longer-lived storage.
+	 */
 	static bool initialized = false;
 	static pthread_mutex_t init_mutex = PTHREAD_MUTEX_INITIALIZER;
 	int			lockerr;
@@ -976,24 +977,10 @@ use_builtin_flow(PGconn *conn, fe_oauth_state *state, PGoauthBearerRequestV2 *re
 	}
 
 	return (start_flow(conn, request) == 0) ? 1 : -1;
-}
-
 #else
-
-/*
- * For static builds, we can just call pg_start_oauthbearer() directly. It's
- * provided by libpq-oauth.a.
- */
-
-extern int	pg_start_oauthbearer(PGconn *conn, PGoauthBearerRequestV2 *request);
-
-static int
-use_builtin_flow(PGconn *conn, fe_oauth_state *state, PGoauthBearerRequestV2 *request)
-{
 	return (pg_start_oauthbearer(conn, request) == 0) ? 1 : -1;
-}
-
 #endif							/* USE_LIBCURL */
+}
 
 
 /*
-- 
2.53.0


--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
 filename=v1-0002-Collapse-SH_CREATE-into-a-single-definition.patch



^ permalink  raw  reply  [nested|flat] 57+ messages in thread

* [PATCH v1 1/2] libpq-oauth: collapse use_builtin_flow() into a single definition
@ 2026-07-01 10:31 Jonathan Gonzalez V. <[email protected]>
  0 siblings, 0 replies; 57+ messages in thread

From: Jonathan Gonzalez V. @ 2026-07-01 10:31 UTC (permalink / raw)

There was three separated definition of the function making lcov v2.x fail
with an error.
---
 src/interfaces/libpq/fe-auth-oauth.c | 61 +++++++++++-----------------
 1 file changed, 24 insertions(+), 37 deletions(-)

diff --git a/src/interfaces/libpq/fe-auth-oauth.c b/src/interfaces/libpq/fe-auth-oauth.c
index 826f7461cb3..7a35647feb8 100644
--- a/src/interfaces/libpq/fe-auth-oauth.c
+++ b/src/interfaces/libpq/fe-auth-oauth.c
@@ -833,41 +833,42 @@ cleanup_oauth_flow(PGconn *conn)
  * failure, and positive indicates success.
  */
 
-#if !defined(USE_LIBCURL)
+#if defined(USE_LIBCURL) && defined(USE_DYNAMIC_OAUTH)
 
 /*
- * This configuration doesn't support the builtin flow.
+ * Use the builtin flow in the libpq-oauth plugin, which is loaded at runtime.
  */
 
-static int
-use_builtin_flow(PGconn *conn, fe_oauth_state *state, PGoauthBearerRequestV2 *request)
-{
-	return 0;
-}
+typedef char *(*libpq_gettext_func) (const char *msgid);
 
-#elif defined(USE_DYNAMIC_OAUTH)
+#elif defined(USE_LIBCURL)
 
 /*
- * Use the builtin flow in the libpq-oauth plugin, which is loaded at runtime.
+ * For static builds, we can just call pg_start_oauthbearer() directly. It's
+ * provided by libpq-oauth.a.
  */
+extern int	pg_start_oauthbearer(PGconn *conn, PGoauthBearerRequestV2 *request);
 
-typedef char *(*libpq_gettext_func) (const char *msgid);
+#endif
 
-/*
- * Loads the libpq-oauth plugin via dlopen(), initializes it, and plugs its
- * callbacks into the connection's async auth handlers.
- *
- * Failure to load here results in a relatively quiet connection error, to
- * handle the use case where the build supports loading a flow but a user does
- * not want to install it. Troubleshooting of linker/loader failures can be done
- * via PGOAUTHDEBUG.
- *
- * The lifetime of *request ends shortly after this call, so it must be copied
- * to longer-lived storage.
- */
 static int
 use_builtin_flow(PGconn *conn, fe_oauth_state *state, PGoauthBearerRequestV2 *request)
 {
+#if !defined(USE_LIBCURL)
+	return 0;
+#elif defined(USE_DYNAMIC_OAUTH)
+	/*
+	 * Load the libpq-oauth plugin via dlopen(), initialize it, and plug its
+	 * callbacks into the connection's async auth handlers.
+	 *
+	 * Failure to load here results in a relatively quiet connection error, to
+	 * handle the use case where the build supports loading a flow but a user
+	 * does not want to install it. Troubleshooting of linker/loader failures
+	 * can be done via PGOAUTHDEBUG.
+	 *
+	 * The lifetime of *request ends shortly after this call, so it must be
+	 * copied to longer-lived storage.
+	 */
 	static bool initialized = false;
 	static pthread_mutex_t init_mutex = PTHREAD_MUTEX_INITIALIZER;
 	int			lockerr;
@@ -976,24 +977,10 @@ use_builtin_flow(PGconn *conn, fe_oauth_state *state, PGoauthBearerRequestV2 *re
 	}
 
 	return (start_flow(conn, request) == 0) ? 1 : -1;
-}
-
 #else
-
-/*
- * For static builds, we can just call pg_start_oauthbearer() directly. It's
- * provided by libpq-oauth.a.
- */
-
-extern int	pg_start_oauthbearer(PGconn *conn, PGoauthBearerRequestV2 *request);
-
-static int
-use_builtin_flow(PGconn *conn, fe_oauth_state *state, PGoauthBearerRequestV2 *request)
-{
 	return (pg_start_oauthbearer(conn, request) == 0) ? 1 : -1;
-}
-
 #endif							/* USE_LIBCURL */
+}
 
 
 /*
-- 
2.53.0


--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
 filename=v1-0002-Collapse-SH_CREATE-into-a-single-definition.patch



^ permalink  raw  reply  [nested|flat] 57+ messages in thread

* [PATCH v1 1/2] libpq-oauth: collapse use_builtin_flow() into a single definition
@ 2026-07-01 10:31 Jonathan Gonzalez V. <[email protected]>
  0 siblings, 0 replies; 57+ messages in thread

From: Jonathan Gonzalez V. @ 2026-07-01 10:31 UTC (permalink / raw)

There was three separated definition of the function making lcov v2.x fail
with an error.
---
 src/interfaces/libpq/fe-auth-oauth.c | 61 +++++++++++-----------------
 1 file changed, 24 insertions(+), 37 deletions(-)

diff --git a/src/interfaces/libpq/fe-auth-oauth.c b/src/interfaces/libpq/fe-auth-oauth.c
index 826f7461cb3..7a35647feb8 100644
--- a/src/interfaces/libpq/fe-auth-oauth.c
+++ b/src/interfaces/libpq/fe-auth-oauth.c
@@ -833,41 +833,42 @@ cleanup_oauth_flow(PGconn *conn)
  * failure, and positive indicates success.
  */
 
-#if !defined(USE_LIBCURL)
+#if defined(USE_LIBCURL) && defined(USE_DYNAMIC_OAUTH)
 
 /*
- * This configuration doesn't support the builtin flow.
+ * Use the builtin flow in the libpq-oauth plugin, which is loaded at runtime.
  */
 
-static int
-use_builtin_flow(PGconn *conn, fe_oauth_state *state, PGoauthBearerRequestV2 *request)
-{
-	return 0;
-}
+typedef char *(*libpq_gettext_func) (const char *msgid);
 
-#elif defined(USE_DYNAMIC_OAUTH)
+#elif defined(USE_LIBCURL)
 
 /*
- * Use the builtin flow in the libpq-oauth plugin, which is loaded at runtime.
+ * For static builds, we can just call pg_start_oauthbearer() directly. It's
+ * provided by libpq-oauth.a.
  */
+extern int	pg_start_oauthbearer(PGconn *conn, PGoauthBearerRequestV2 *request);
 
-typedef char *(*libpq_gettext_func) (const char *msgid);
+#endif
 
-/*
- * Loads the libpq-oauth plugin via dlopen(), initializes it, and plugs its
- * callbacks into the connection's async auth handlers.
- *
- * Failure to load here results in a relatively quiet connection error, to
- * handle the use case where the build supports loading a flow but a user does
- * not want to install it. Troubleshooting of linker/loader failures can be done
- * via PGOAUTHDEBUG.
- *
- * The lifetime of *request ends shortly after this call, so it must be copied
- * to longer-lived storage.
- */
 static int
 use_builtin_flow(PGconn *conn, fe_oauth_state *state, PGoauthBearerRequestV2 *request)
 {
+#if !defined(USE_LIBCURL)
+	return 0;
+#elif defined(USE_DYNAMIC_OAUTH)
+	/*
+	 * Load the libpq-oauth plugin via dlopen(), initialize it, and plug its
+	 * callbacks into the connection's async auth handlers.
+	 *
+	 * Failure to load here results in a relatively quiet connection error, to
+	 * handle the use case where the build supports loading a flow but a user
+	 * does not want to install it. Troubleshooting of linker/loader failures
+	 * can be done via PGOAUTHDEBUG.
+	 *
+	 * The lifetime of *request ends shortly after this call, so it must be
+	 * copied to longer-lived storage.
+	 */
 	static bool initialized = false;
 	static pthread_mutex_t init_mutex = PTHREAD_MUTEX_INITIALIZER;
 	int			lockerr;
@@ -976,24 +977,10 @@ use_builtin_flow(PGconn *conn, fe_oauth_state *state, PGoauthBearerRequestV2 *re
 	}
 
 	return (start_flow(conn, request) == 0) ? 1 : -1;
-}
-
 #else
-
-/*
- * For static builds, we can just call pg_start_oauthbearer() directly. It's
- * provided by libpq-oauth.a.
- */
-
-extern int	pg_start_oauthbearer(PGconn *conn, PGoauthBearerRequestV2 *request);
-
-static int
-use_builtin_flow(PGconn *conn, fe_oauth_state *state, PGoauthBearerRequestV2 *request)
-{
 	return (pg_start_oauthbearer(conn, request) == 0) ? 1 : -1;
-}
-
 #endif							/* USE_LIBCURL */
+}
 
 
 /*
-- 
2.53.0


--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
 filename=v1-0002-Collapse-SH_CREATE-into-a-single-definition.patch



^ permalink  raw  reply  [nested|flat] 57+ messages in thread

* [PATCH v1 1/2] libpq-oauth: collapse use_builtin_flow() into a single definition
@ 2026-07-01 10:31 Jonathan Gonzalez V. <[email protected]>
  0 siblings, 0 replies; 57+ messages in thread

From: Jonathan Gonzalez V. @ 2026-07-01 10:31 UTC (permalink / raw)

There was three separated definition of the function making lcov v2.x fail
with an error.
---
 src/interfaces/libpq/fe-auth-oauth.c | 61 +++++++++++-----------------
 1 file changed, 24 insertions(+), 37 deletions(-)

diff --git a/src/interfaces/libpq/fe-auth-oauth.c b/src/interfaces/libpq/fe-auth-oauth.c
index 826f7461cb3..7a35647feb8 100644
--- a/src/interfaces/libpq/fe-auth-oauth.c
+++ b/src/interfaces/libpq/fe-auth-oauth.c
@@ -833,41 +833,42 @@ cleanup_oauth_flow(PGconn *conn)
  * failure, and positive indicates success.
  */
 
-#if !defined(USE_LIBCURL)
+#if defined(USE_LIBCURL) && defined(USE_DYNAMIC_OAUTH)
 
 /*
- * This configuration doesn't support the builtin flow.
+ * Use the builtin flow in the libpq-oauth plugin, which is loaded at runtime.
  */
 
-static int
-use_builtin_flow(PGconn *conn, fe_oauth_state *state, PGoauthBearerRequestV2 *request)
-{
-	return 0;
-}
+typedef char *(*libpq_gettext_func) (const char *msgid);
 
-#elif defined(USE_DYNAMIC_OAUTH)
+#elif defined(USE_LIBCURL)
 
 /*
- * Use the builtin flow in the libpq-oauth plugin, which is loaded at runtime.
+ * For static builds, we can just call pg_start_oauthbearer() directly. It's
+ * provided by libpq-oauth.a.
  */
+extern int	pg_start_oauthbearer(PGconn *conn, PGoauthBearerRequestV2 *request);
 
-typedef char *(*libpq_gettext_func) (const char *msgid);
+#endif
 
-/*
- * Loads the libpq-oauth plugin via dlopen(), initializes it, and plugs its
- * callbacks into the connection's async auth handlers.
- *
- * Failure to load here results in a relatively quiet connection error, to
- * handle the use case where the build supports loading a flow but a user does
- * not want to install it. Troubleshooting of linker/loader failures can be done
- * via PGOAUTHDEBUG.
- *
- * The lifetime of *request ends shortly after this call, so it must be copied
- * to longer-lived storage.
- */
 static int
 use_builtin_flow(PGconn *conn, fe_oauth_state *state, PGoauthBearerRequestV2 *request)
 {
+#if !defined(USE_LIBCURL)
+	return 0;
+#elif defined(USE_DYNAMIC_OAUTH)
+	/*
+	 * Load the libpq-oauth plugin via dlopen(), initialize it, and plug its
+	 * callbacks into the connection's async auth handlers.
+	 *
+	 * Failure to load here results in a relatively quiet connection error, to
+	 * handle the use case where the build supports loading a flow but a user
+	 * does not want to install it. Troubleshooting of linker/loader failures
+	 * can be done via PGOAUTHDEBUG.
+	 *
+	 * The lifetime of *request ends shortly after this call, so it must be
+	 * copied to longer-lived storage.
+	 */
 	static bool initialized = false;
 	static pthread_mutex_t init_mutex = PTHREAD_MUTEX_INITIALIZER;
 	int			lockerr;
@@ -976,24 +977,10 @@ use_builtin_flow(PGconn *conn, fe_oauth_state *state, PGoauthBearerRequestV2 *re
 	}
 
 	return (start_flow(conn, request) == 0) ? 1 : -1;
-}
-
 #else
-
-/*
- * For static builds, we can just call pg_start_oauthbearer() directly. It's
- * provided by libpq-oauth.a.
- */
-
-extern int	pg_start_oauthbearer(PGconn *conn, PGoauthBearerRequestV2 *request);
-
-static int
-use_builtin_flow(PGconn *conn, fe_oauth_state *state, PGoauthBearerRequestV2 *request)
-{
 	return (pg_start_oauthbearer(conn, request) == 0) ? 1 : -1;
-}
-
 #endif							/* USE_LIBCURL */
+}
 
 
 /*
-- 
2.53.0


--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
 filename=v1-0002-Collapse-SH_CREATE-into-a-single-definition.patch



^ permalink  raw  reply  [nested|flat] 57+ messages in thread

* [PATCH v1 1/2] libpq-oauth: collapse use_builtin_flow() into a single definition
@ 2026-07-01 10:31 Jonathan Gonzalez V. <[email protected]>
  0 siblings, 0 replies; 57+ messages in thread

From: Jonathan Gonzalez V. @ 2026-07-01 10:31 UTC (permalink / raw)

There was three separated definition of the function making lcov v2.x fail
with an error.
---
 src/interfaces/libpq/fe-auth-oauth.c | 61 +++++++++++-----------------
 1 file changed, 24 insertions(+), 37 deletions(-)

diff --git a/src/interfaces/libpq/fe-auth-oauth.c b/src/interfaces/libpq/fe-auth-oauth.c
index 826f7461cb3..7a35647feb8 100644
--- a/src/interfaces/libpq/fe-auth-oauth.c
+++ b/src/interfaces/libpq/fe-auth-oauth.c
@@ -833,41 +833,42 @@ cleanup_oauth_flow(PGconn *conn)
  * failure, and positive indicates success.
  */
 
-#if !defined(USE_LIBCURL)
+#if defined(USE_LIBCURL) && defined(USE_DYNAMIC_OAUTH)
 
 /*
- * This configuration doesn't support the builtin flow.
+ * Use the builtin flow in the libpq-oauth plugin, which is loaded at runtime.
  */
 
-static int
-use_builtin_flow(PGconn *conn, fe_oauth_state *state, PGoauthBearerRequestV2 *request)
-{
-	return 0;
-}
+typedef char *(*libpq_gettext_func) (const char *msgid);
 
-#elif defined(USE_DYNAMIC_OAUTH)
+#elif defined(USE_LIBCURL)
 
 /*
- * Use the builtin flow in the libpq-oauth plugin, which is loaded at runtime.
+ * For static builds, we can just call pg_start_oauthbearer() directly. It's
+ * provided by libpq-oauth.a.
  */
+extern int	pg_start_oauthbearer(PGconn *conn, PGoauthBearerRequestV2 *request);
 
-typedef char *(*libpq_gettext_func) (const char *msgid);
+#endif
 
-/*
- * Loads the libpq-oauth plugin via dlopen(), initializes it, and plugs its
- * callbacks into the connection's async auth handlers.
- *
- * Failure to load here results in a relatively quiet connection error, to
- * handle the use case where the build supports loading a flow but a user does
- * not want to install it. Troubleshooting of linker/loader failures can be done
- * via PGOAUTHDEBUG.
- *
- * The lifetime of *request ends shortly after this call, so it must be copied
- * to longer-lived storage.
- */
 static int
 use_builtin_flow(PGconn *conn, fe_oauth_state *state, PGoauthBearerRequestV2 *request)
 {
+#if !defined(USE_LIBCURL)
+	return 0;
+#elif defined(USE_DYNAMIC_OAUTH)
+	/*
+	 * Load the libpq-oauth plugin via dlopen(), initialize it, and plug its
+	 * callbacks into the connection's async auth handlers.
+	 *
+	 * Failure to load here results in a relatively quiet connection error, to
+	 * handle the use case where the build supports loading a flow but a user
+	 * does not want to install it. Troubleshooting of linker/loader failures
+	 * can be done via PGOAUTHDEBUG.
+	 *
+	 * The lifetime of *request ends shortly after this call, so it must be
+	 * copied to longer-lived storage.
+	 */
 	static bool initialized = false;
 	static pthread_mutex_t init_mutex = PTHREAD_MUTEX_INITIALIZER;
 	int			lockerr;
@@ -976,24 +977,10 @@ use_builtin_flow(PGconn *conn, fe_oauth_state *state, PGoauthBearerRequestV2 *re
 	}
 
 	return (start_flow(conn, request) == 0) ? 1 : -1;
-}
-
 #else
-
-/*
- * For static builds, we can just call pg_start_oauthbearer() directly. It's
- * provided by libpq-oauth.a.
- */
-
-extern int	pg_start_oauthbearer(PGconn *conn, PGoauthBearerRequestV2 *request);
-
-static int
-use_builtin_flow(PGconn *conn, fe_oauth_state *state, PGoauthBearerRequestV2 *request)
-{
 	return (pg_start_oauthbearer(conn, request) == 0) ? 1 : -1;
-}
-
 #endif							/* USE_LIBCURL */
+}
 
 
 /*
-- 
2.53.0


--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
 filename=v1-0002-Collapse-SH_CREATE-into-a-single-definition.patch



^ permalink  raw  reply  [nested|flat] 57+ messages in thread

* [PATCH v1 1/2] libpq-oauth: collapse use_builtin_flow() into a single definition
@ 2026-07-01 10:31 Jonathan Gonzalez V. <[email protected]>
  0 siblings, 0 replies; 57+ messages in thread

From: Jonathan Gonzalez V. @ 2026-07-01 10:31 UTC (permalink / raw)

There was three separated definition of the function making lcov v2.x fail
with an error.
---
 src/interfaces/libpq/fe-auth-oauth.c | 61 +++++++++++-----------------
 1 file changed, 24 insertions(+), 37 deletions(-)

diff --git a/src/interfaces/libpq/fe-auth-oauth.c b/src/interfaces/libpq/fe-auth-oauth.c
index 826f7461cb3..7a35647feb8 100644
--- a/src/interfaces/libpq/fe-auth-oauth.c
+++ b/src/interfaces/libpq/fe-auth-oauth.c
@@ -833,41 +833,42 @@ cleanup_oauth_flow(PGconn *conn)
  * failure, and positive indicates success.
  */
 
-#if !defined(USE_LIBCURL)
+#if defined(USE_LIBCURL) && defined(USE_DYNAMIC_OAUTH)
 
 /*
- * This configuration doesn't support the builtin flow.
+ * Use the builtin flow in the libpq-oauth plugin, which is loaded at runtime.
  */
 
-static int
-use_builtin_flow(PGconn *conn, fe_oauth_state *state, PGoauthBearerRequestV2 *request)
-{
-	return 0;
-}
+typedef char *(*libpq_gettext_func) (const char *msgid);
 
-#elif defined(USE_DYNAMIC_OAUTH)
+#elif defined(USE_LIBCURL)
 
 /*
- * Use the builtin flow in the libpq-oauth plugin, which is loaded at runtime.
+ * For static builds, we can just call pg_start_oauthbearer() directly. It's
+ * provided by libpq-oauth.a.
  */
+extern int	pg_start_oauthbearer(PGconn *conn, PGoauthBearerRequestV2 *request);
 
-typedef char *(*libpq_gettext_func) (const char *msgid);
+#endif
 
-/*
- * Loads the libpq-oauth plugin via dlopen(), initializes it, and plugs its
- * callbacks into the connection's async auth handlers.
- *
- * Failure to load here results in a relatively quiet connection error, to
- * handle the use case where the build supports loading a flow but a user does
- * not want to install it. Troubleshooting of linker/loader failures can be done
- * via PGOAUTHDEBUG.
- *
- * The lifetime of *request ends shortly after this call, so it must be copied
- * to longer-lived storage.
- */
 static int
 use_builtin_flow(PGconn *conn, fe_oauth_state *state, PGoauthBearerRequestV2 *request)
 {
+#if !defined(USE_LIBCURL)
+	return 0;
+#elif defined(USE_DYNAMIC_OAUTH)
+	/*
+	 * Load the libpq-oauth plugin via dlopen(), initialize it, and plug its
+	 * callbacks into the connection's async auth handlers.
+	 *
+	 * Failure to load here results in a relatively quiet connection error, to
+	 * handle the use case where the build supports loading a flow but a user
+	 * does not want to install it. Troubleshooting of linker/loader failures
+	 * can be done via PGOAUTHDEBUG.
+	 *
+	 * The lifetime of *request ends shortly after this call, so it must be
+	 * copied to longer-lived storage.
+	 */
 	static bool initialized = false;
 	static pthread_mutex_t init_mutex = PTHREAD_MUTEX_INITIALIZER;
 	int			lockerr;
@@ -976,24 +977,10 @@ use_builtin_flow(PGconn *conn, fe_oauth_state *state, PGoauthBearerRequestV2 *re
 	}
 
 	return (start_flow(conn, request) == 0) ? 1 : -1;
-}
-
 #else
-
-/*
- * For static builds, we can just call pg_start_oauthbearer() directly. It's
- * provided by libpq-oauth.a.
- */
-
-extern int	pg_start_oauthbearer(PGconn *conn, PGoauthBearerRequestV2 *request);
-
-static int
-use_builtin_flow(PGconn *conn, fe_oauth_state *state, PGoauthBearerRequestV2 *request)
-{
 	return (pg_start_oauthbearer(conn, request) == 0) ? 1 : -1;
-}
-
 #endif							/* USE_LIBCURL */
+}
 
 
 /*
-- 
2.53.0


--=-=-=
Content-Type: text/x-diff
Content-Disposition: attachment;
 filename=v1-0002-Collapse-SH_CREATE-into-a-single-definition.patch



^ permalink  raw  reply  [nested|flat] 57+ messages in thread


end of thread, other threads:[~2026-07-01 10:31 UTC | newest]

Thread overview: 57+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2020-11-11 08:01 [PATCH v31 04/11] Add Incremental View Maintenance support to pg_dump Yugo Nagata <[email protected]>
2026-07-01 10:31 [PATCH v1 1/2] libpq-oauth: collapse use_builtin_flow() into a single definition Jonathan Gonzalez V. <[email protected]>
2026-07-01 10:31 [PATCH v1 1/2] libpq-oauth: collapse use_builtin_flow() into a single definition Jonathan Gonzalez V. <[email protected]>
2026-07-01 10:31 [PATCH v1 1/2] libpq-oauth: collapse use_builtin_flow() into a single definition Jonathan Gonzalez V. <[email protected]>
2026-07-01 10:31 [PATCH v1 1/2] libpq-oauth: collapse use_builtin_flow() into a single definition Jonathan Gonzalez V. <[email protected]>
2026-07-01 10:31 [PATCH v1 1/2] libpq-oauth: collapse use_builtin_flow() into a single definition Jonathan Gonzalez V. <[email protected]>
2026-07-01 10:31 [PATCH v1 1/2] libpq-oauth: collapse use_builtin_flow() into a single definition Jonathan Gonzalez V. <[email protected]>
2026-07-01 10:31 [PATCH v1 1/2] libpq-oauth: collapse use_builtin_flow() into a single definition Jonathan Gonzalez V. <[email protected]>
2026-07-01 10:31 [PATCH v1 1/2] libpq-oauth: collapse use_builtin_flow() into a single definition Jonathan Gonzalez V. <[email protected]>
2026-07-01 10:31 [PATCH v1 1/2] libpq-oauth: collapse use_builtin_flow() into a single definition Jonathan Gonzalez V. <[email protected]>
2026-07-01 10:31 [PATCH v1 1/2] libpq-oauth: collapse use_builtin_flow() into a single definition Jonathan Gonzalez V. <[email protected]>
2026-07-01 10:31 [PATCH v1 1/2] libpq-oauth: collapse use_builtin_flow() into a single definition Jonathan Gonzalez V. <[email protected]>
2026-07-01 10:31 [PATCH v1 1/2] libpq-oauth: collapse use_builtin_flow() into a single definition Jonathan Gonzalez V. <[email protected]>
2026-07-01 10:31 [PATCH v1 1/2] libpq-oauth: collapse use_builtin_flow() into a single definition Jonathan Gonzalez V. <[email protected]>
2026-07-01 10:31 [PATCH v1 1/2] libpq-oauth: collapse use_builtin_flow() into a single definition Jonathan Gonzalez V. <[email protected]>
2026-07-01 10:31 [PATCH v1 1/2] libpq-oauth: collapse use_builtin_flow() into a single definition Jonathan Gonzalez V. <[email protected]>
2026-07-01 10:31 [PATCH v1 1/2] libpq-oauth: collapse use_builtin_flow() into a single definition Jonathan Gonzalez V. <[email protected]>
2026-07-01 10:31 [PATCH v1 1/2] libpq-oauth: collapse use_builtin_flow() into a single definition Jonathan Gonzalez V. <[email protected]>
2026-07-01 10:31 [PATCH v1 1/2] libpq-oauth: collapse use_builtin_flow() into a single definition Jonathan Gonzalez V. <[email protected]>
2026-07-01 10:31 [PATCH v1 1/2] libpq-oauth: collapse use_builtin_flow() into a single definition Jonathan Gonzalez V. <[email protected]>
2026-07-01 10:31 [PATCH v1 1/2] libpq-oauth: collapse use_builtin_flow() into a single definition Jonathan Gonzalez V. <[email protected]>
2026-07-01 10:31 [PATCH v1 1/2] libpq-oauth: collapse use_builtin_flow() into a single definition Jonathan Gonzalez V. <[email protected]>
2026-07-01 10:31 [PATCH v1 1/2] libpq-oauth: collapse use_builtin_flow() into a single definition Jonathan Gonzalez V. <[email protected]>
2026-07-01 10:31 [PATCH v1 1/2] libpq-oauth: collapse use_builtin_flow() into a single definition Jonathan Gonzalez V. <[email protected]>
2026-07-01 10:31 [PATCH v1 1/2] libpq-oauth: collapse use_builtin_flow() into a single definition Jonathan Gonzalez V. <[email protected]>
2026-07-01 10:31 [PATCH v1 1/2] libpq-oauth: collapse use_builtin_flow() into a single definition Jonathan Gonzalez V. <[email protected]>
2026-07-01 10:31 [PATCH v1 1/2] libpq-oauth: collapse use_builtin_flow() into a single definition Jonathan Gonzalez V. <[email protected]>
2026-07-01 10:31 [PATCH v1 1/2] libpq-oauth: collapse use_builtin_flow() into a single definition Jonathan Gonzalez V. <[email protected]>
2026-07-01 10:31 [PATCH v1 1/2] libpq-oauth: collapse use_builtin_flow() into a single definition Jonathan Gonzalez V. <[email protected]>
2026-07-01 10:31 [PATCH v1 1/2] libpq-oauth: collapse use_builtin_flow() into a single definition Jonathan Gonzalez V. <[email protected]>
2026-07-01 10:31 [PATCH v1 1/2] libpq-oauth: collapse use_builtin_flow() into a single definition Jonathan Gonzalez V. <[email protected]>
2026-07-01 10:31 [PATCH v1 1/2] libpq-oauth: collapse use_builtin_flow() into a single definition Jonathan Gonzalez V. <[email protected]>
2026-07-01 10:31 [PATCH v1 1/2] libpq-oauth: collapse use_builtin_flow() into a single definition Jonathan Gonzalez V. <[email protected]>
2026-07-01 10:31 [PATCH v1 1/2] libpq-oauth: collapse use_builtin_flow() into a single definition Jonathan Gonzalez V. <[email protected]>
2026-07-01 10:31 [PATCH v1 1/2] libpq-oauth: collapse use_builtin_flow() into a single definition Jonathan Gonzalez V. <[email protected]>
2026-07-01 10:31 [PATCH v1 1/2] libpq-oauth: collapse use_builtin_flow() into a single definition Jonathan Gonzalez V. <[email protected]>
2026-07-01 10:31 [PATCH v1 1/2] libpq-oauth: collapse use_builtin_flow() into a single definition Jonathan Gonzalez V. <[email protected]>
2026-07-01 10:31 [PATCH v1 1/2] libpq-oauth: collapse use_builtin_flow() into a single definition Jonathan Gonzalez V. <[email protected]>
2026-07-01 10:31 [PATCH v1 1/2] libpq-oauth: collapse use_builtin_flow() into a single definition Jonathan Gonzalez V. <[email protected]>
2026-07-01 10:31 [PATCH v1 1/2] libpq-oauth: collapse use_builtin_flow() into a single definition Jonathan Gonzalez V. <[email protected]>
2026-07-01 10:31 [PATCH v1 1/2] libpq-oauth: collapse use_builtin_flow() into a single definition Jonathan Gonzalez V. <[email protected]>
2026-07-01 10:31 [PATCH v1 1/2] libpq-oauth: collapse use_builtin_flow() into a single definition Jonathan Gonzalez V. <[email protected]>
2026-07-01 10:31 [PATCH v1 1/2] libpq-oauth: collapse use_builtin_flow() into a single definition Jonathan Gonzalez V. <[email protected]>
2026-07-01 10:31 [PATCH v1 1/2] libpq-oauth: collapse use_builtin_flow() into a single definition Jonathan Gonzalez V. <[email protected]>
2026-07-01 10:31 [PATCH v1 1/2] libpq-oauth: collapse use_builtin_flow() into a single definition Jonathan Gonzalez V. <[email protected]>
2026-07-01 10:31 [PATCH v1 1/2] libpq-oauth: collapse use_builtin_flow() into a single definition Jonathan Gonzalez V. <[email protected]>
2026-07-01 10:31 [PATCH v1 1/2] libpq-oauth: collapse use_builtin_flow() into a single definition Jonathan Gonzalez V. <[email protected]>
2026-07-01 10:31 [PATCH v1 1/2] libpq-oauth: collapse use_builtin_flow() into a single definition Jonathan Gonzalez V. <[email protected]>
2026-07-01 10:31 [PATCH v1 1/2] libpq-oauth: collapse use_builtin_flow() into a single definition Jonathan Gonzalez V. <[email protected]>
2026-07-01 10:31 [PATCH v1 1/2] libpq-oauth: collapse use_builtin_flow() into a single definition Jonathan Gonzalez V. <[email protected]>
2026-07-01 10:31 [PATCH v1 1/2] libpq-oauth: collapse use_builtin_flow() into a single definition Jonathan Gonzalez V. <[email protected]>
2026-07-01 10:31 [PATCH v1 1/2] libpq-oauth: collapse use_builtin_flow() into a single definition Jonathan Gonzalez V. <[email protected]>
2026-07-01 10:31 [PATCH v1 1/2] libpq-oauth: collapse use_builtin_flow() into a single definition Jonathan Gonzalez V. <[email protected]>
2026-07-01 10:31 [PATCH v1 1/2] libpq-oauth: collapse use_builtin_flow() into a single definition Jonathan Gonzalez V. <[email protected]>
2026-07-01 10:31 [PATCH v1 1/2] libpq-oauth: collapse use_builtin_flow() into a single definition Jonathan Gonzalez V. <[email protected]>
2026-07-01 10:31 [PATCH v1 1/2] libpq-oauth: collapse use_builtin_flow() into a single definition Jonathan Gonzalez V. <[email protected]>
2026-07-01 10:31 [PATCH v1 1/2] libpq-oauth: collapse use_builtin_flow() into a single definition Jonathan Gonzalez V. <[email protected]>

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