agora inbox for pgsql-hackers@postgresql.org  
help / color / mirror / Atom feed
[PATCH v2 1/6] Handle pg_get_ruledef default args in system_functions.sql
908+ messages / 2 participants
[nested] [flat]

* [PATCH v2 1/6] Handle pg_get_ruledef default args in system_functions.sql
@ 2025-12-08 23:41 Mark Wong <markwkm@gmail.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Mark Wong @ 2025-12-08 23:41 UTC (permalink / raw)

Modernize pg_get_ruledef to use CREATE OR REPLACE FUNCTION to handle the
optional pretty argument.
---
 src/backend/catalog/system_functions.sql |  7 +++++++
 src/backend/utils/adt/ruleutils.c        | 18 ------------------
 src/include/catalog/pg_proc.dat          |  5 +----
 3 files changed, 8 insertions(+), 22 deletions(-)

diff --git a/src/backend/catalog/system_functions.sql b/src/backend/catalog/system_functions.sql
index eb9e31ae1bf..3aad2fbf8f3 100644
--- a/src/backend/catalog/system_functions.sql
+++ b/src/backend/catalog/system_functions.sql
@@ -657,6 +657,13 @@ LANGUAGE INTERNAL
 STRICT VOLATILE PARALLEL UNSAFE
 AS 'pg_replication_origin_session_setup';
 
+CREATE OR REPLACE FUNCTION
+  pg_get_ruledef(rule oid, pretty bool DEFAULT false)
+RETURNS TEXT
+LANGUAGE INTERNAL
+PARALLEL SAFE
+AS 'pg_get_ruledef';
+
 --
 -- The default permissions for functions mean that anyone can execute them.
 -- A number of functions shouldn't be executable by just anyone, but rather
diff --git a/src/backend/utils/adt/ruleutils.c b/src/backend/utils/adt/ruleutils.c
index 416f1a21ae4..c4d424ba10d 100644
--- a/src/backend/utils/adt/ruleutils.c
+++ b/src/backend/utils/adt/ruleutils.c
@@ -558,24 +558,6 @@ static void get_json_table_nested_columns(TableFunc *tf, JsonTablePlan *plan,
  */
 Datum
 pg_get_ruledef(PG_FUNCTION_ARGS)
-{
-	Oid			ruleoid = PG_GETARG_OID(0);
-	int			prettyFlags;
-	char	   *res;
-
-	prettyFlags = PRETTYFLAG_INDENT;
-
-	res = pg_get_ruledef_worker(ruleoid, prettyFlags);
-
-	if (res == NULL)
-		PG_RETURN_NULL();
-
-	PG_RETURN_TEXT_P(string_to_text(res));
-}
-
-
-Datum
-pg_get_ruledef_ext(PG_FUNCTION_ARGS)
 {
 	Oid			ruleoid = PG_GETARG_OID(0);
 	bool		pretty = PG_GETARG_BOOL(1);
diff --git a/src/include/catalog/pg_proc.dat b/src/include/catalog/pg_proc.dat
index 2ac69bf2df5..597c468983e 100644
--- a/src/include/catalog/pg_proc.dat
+++ b/src/include/catalog/pg_proc.dat
@@ -3961,9 +3961,6 @@
   proargtypes => 'oid oid', prosrc => 'oidge' },
 
 # System-view support functions
-{ oid => '1573', descr => 'source text of a rule',
-  proname => 'pg_get_ruledef', provolatile => 's', prorettype => 'text',
-  proargtypes => 'oid', prosrc => 'pg_get_ruledef' },
 { oid => '1640', descr => 'select statement of a view',
   proname => 'pg_get_viewdef', provolatile => 's', proparallel => 'r',
   prorettype => 'text', proargtypes => 'text',
@@ -8508,7 +8505,7 @@
 # System-view support functions with pretty-print option
 { oid => '2504', descr => 'source text of a rule with pretty-print option',
   proname => 'pg_get_ruledef', provolatile => 's', prorettype => 'text',
-  proargtypes => 'oid bool', prosrc => 'pg_get_ruledef_ext' },
+  proargtypes => 'oid bool', prosrc => 'pg_get_ruledef' },
 { oid => '2505',
   descr => 'select statement of a view with pretty-print option',
   proname => 'pg_get_viewdef', provolatile => 's', proparallel => 'r',
-- 
2.43.0


--3/nz5wg6+DYwHsLU
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
	filename="v2-0002-Handle-pg_get_viewdef-default-args-in-system_func.patch"



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



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

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 908+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 908+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 908+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 908+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 908+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 908+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 908+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 908+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 908+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 908+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 908+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 908+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 908+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 908+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 908+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 908+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 908+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 908+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 908+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 908+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 908+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 908+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 908+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 908+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 908+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 908+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 908+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 908+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 908+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 908+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 908+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 908+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 908+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 908+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 908+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 908+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 908+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 908+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 908+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 908+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 908+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 908+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 908+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 908+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 908+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 908+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 908+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 908+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 908+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 908+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 908+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 908+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 908+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 908+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 908+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 908+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 908+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 908+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 908+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 908+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 908+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 908+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 908+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 908+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 908+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 908+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 908+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 908+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 908+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 908+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 908+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 908+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 908+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 908+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 908+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 908+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 908+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 908+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 908+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 908+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 908+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 908+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 908+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 908+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 908+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 908+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 908+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 908+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 908+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 908+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 908+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 908+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 908+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 908+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 908+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 908+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 908+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 908+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 908+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 908+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 908+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 908+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 908+ messages in thread

* [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--Z10p9YYojB0/BzD2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v4-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 908+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 908+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 908+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 908+ messages in thread

* [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64()
@ 2026-06-02 17:22 Reviewer <review@example.com>
  0 siblings, 0 replies; 908+ messages in thread

From: Reviewer @ 2026-06-02 17:22 UTC (permalink / raw)

---
 src/interfaces/libpq/fe-lobj.c | 58 +++-------------------------------
 1 file changed, 4 insertions(+), 54 deletions(-)

diff --git a/src/interfaces/libpq/fe-lobj.c b/src/interfaces/libpq/fe-lobj.c
index 1660c969f58..42b2a36bda9 100644
--- a/src/interfaces/libpq/fe-lobj.c
+++ b/src/interfaces/libpq/fe-lobj.c
@@ -43,8 +43,6 @@
 
 static int	lo_initialize(PGconn *conn);
 static Oid	lo_import_internal(PGconn *conn, const char *filename, Oid oid);
-static int64_t lo_hton64(int64_t host64);
-static int64_t lo_ntoh64(int64_t net64);
 
 /*
  * lo_open
@@ -213,7 +211,7 @@ lo_truncate64(PGconn *conn, int fd, int64_t len)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	len = lo_hton64(len);
+	len = pg_hton64(len);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &len;
@@ -403,7 +401,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	argv[0].len = 4;
 	argv[0].u.integer = fd;
 
-	offset = lo_hton64(offset);
+	offset = pg_hton64(offset);
 	argv[1].isint = 0;
 	argv[1].len = 8;
 	argv[1].u.ptr = (int *) &offset;
@@ -417,7 +415,7 @@ lo_lseek64(PGconn *conn, int fd, int64_t offset, int whence)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -571,7 +569,7 @@ lo_tell64(PGconn *conn, int fd)
 	if (PQresultStatus(res) == PGRES_COMMAND_OK && result_len == 8)
 	{
 		PQclear(res);
-		return lo_ntoh64(retval);
+		return pg_ntoh64(retval);
 	}
 	else
 	{
@@ -1014,51 +1012,3 @@ lo_initialize(PGconn *conn)
 	conn->lobjfuncs = lobjfuncs;
 	return 0;
 }
-
-/*
- * lo_hton64
- *	  converts a 64-bit integer from host byte order to network byte order
- */
-static int64_t
-lo_hton64(int64_t host64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	uint32		t;
-
-	/* High order half first, since we're doing MSB-first */
-	t = (uint32) (host64 >> 32);
-	swap.i32[0] = pg_hton32(t);
-
-	/* Now the low order half */
-	t = (uint32) host64;
-	swap.i32[1] = pg_hton32(t);
-
-	return swap.i64;
-}
-
-/*
- * lo_ntoh64
- *	  converts a 64-bit integer from network byte order to host byte order
- */
-static int64_t
-lo_ntoh64(int64_t net64)
-{
-	union
-	{
-		int64		i64;
-		uint32		i32[2];
-	}			swap;
-	int64		result;
-
-	swap.i64 = net64;
-
-	result = (uint32) pg_ntoh32(swap.i32[0]);
-	result <<= 32;
-	result |= (uint32) pg_ntoh32(swap.i32[1]);
-
-	return result;
-}
-- 
2.50.1 (Apple Git-155)


--6CoALBM/+cswbGQ8
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment;
	filename=v3-0003-add-helper-functions-for-fast-path-arg-setup.patch



^ permalink  raw  reply  [nested|flat] 908+ messages in thread


end of thread, other threads:[~2026-06-02 17:22 UTC | newest]

Thread overview: 908+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2025-12-08 23:41 [PATCH v2 1/6] Handle pg_get_ruledef default args in system_functions.sql Mark Wong <markwkm@gmail.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v4 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>
2026-06-02 17:22 [PATCH v3 2/3] remove lo_hton64() and lo_ntoh64() Reviewer <review@example.com>

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox