From e9a35e9642c6a2d7e28a5bec480e744e13a748a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20B=C3=A4rtschi?= Date: Fri, 24 Apr 2026 10:40:07 +0200 Subject: [PATCH 1/2] fix: forward bufsize option in export/3 recursive call When export/3 is called without :into, it opens a StringIO buffer and recurses with into: set. The bufsize option was not forwarded, causing LargeObject.open/3 to silently fall back to the 65_536 default instead of using the configured value. --- lib/pg_large_objects.ex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/pg_large_objects.ex b/lib/pg_large_objects.ex index 7a77663..df20480 100644 --- a/lib/pg_large_objects.ex +++ b/lib/pg_large_objects.ex @@ -96,7 +96,7 @@ defmodule PgLargeObjects do {:ok, buffer} = StringIO.open("", encoding: :latin1) result = - with :ok <- export(repo, oid, into: IO.binstream(buffer, opts[:bufsize])) do + with :ok <- export(repo, oid, into: IO.binstream(buffer, opts[:bufsize]), bufsize: opts[:bufsize]) do {_input, output} = StringIO.contents(buffer) {:ok, output} end From 0d4c8e5f35dc0d400d210d28b7d00ce6a2b0bca2 Mon Sep 17 00:00:00 2001 From: Frerich Raabe Date: Mon, 27 Apr 2026 15:02:03 +0200 Subject: [PATCH 2/2] mix format --- lib/pg_large_objects.ex | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/pg_large_objects.ex b/lib/pg_large_objects.ex index df20480..13a047a 100644 --- a/lib/pg_large_objects.ex +++ b/lib/pg_large_objects.ex @@ -96,7 +96,11 @@ defmodule PgLargeObjects do {:ok, buffer} = StringIO.open("", encoding: :latin1) result = - with :ok <- export(repo, oid, into: IO.binstream(buffer, opts[:bufsize]), bufsize: opts[:bufsize]) do + with :ok <- + export(repo, oid, + into: IO.binstream(buffer, opts[:bufsize]), + bufsize: opts[:bufsize] + ) do {_input, output} = StringIO.contents(buffer) {:ok, output} end