From 814ac78ec1ae413c88b649dfcf2296560baea15c Mon Sep 17 00:00:00 2001 From: Joel Natividad <1980690+jqnatividad@users.noreply.github.com> Date: Tue, 23 Jan 2024 11:43:02 -0500 Subject: [PATCH] explicitly specify read buffer size when doing COPY --- datapusher/jobs.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/datapusher/jobs.py b/datapusher/jobs.py index 88f64f8..20ff47c 100644 --- a/datapusher/jobs.py +++ b/datapusher/jobs.py @@ -1441,7 +1441,7 @@ def _push_to_datastore(task_id, input, dry_run=False, temp_dir=None): sql.Identifier(resource_id), column_names, ) - with open(tmp, "rb") as f: + with open(tmp, "rb", 8192) as f: try: cur.copy_expert(copy_sql, f) except psycopg2.Error as e: