From b67bbaa7c1b54bff26aed7f305a4be26a9f64efb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1s=20Far=C3=ADas=20Santana?= Date: Fri, 15 Sep 2023 15:32:20 +0200 Subject: [PATCH] chore: Bump psycopg2 (#17390) --- posthog/temporal/workflows/postgres_batch_export.py | 3 ++- requirements.in | 2 +- requirements.txt | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/posthog/temporal/workflows/postgres_batch_export.py b/posthog/temporal/workflows/postgres_batch_export.py index fa83d31404e8e..b81c7496b3adb 100644 --- a/posthog/temporal/workflows/postgres_batch_export.py +++ b/posthog/temporal/workflows/postgres_batch_export.py @@ -58,9 +58,10 @@ def copy_tsv_to_postgres(tsv_file, postgres_connection, schema: str, table_name: tsv_file.seek(0) with postgres_connection.cursor() as cursor: + cursor.execute(sql.SQL("SET search_path TO {schema}").format(schema=sql.Identifier(schema))) cursor.copy_from( tsv_file, - sql.Identifier(schema, table_name).as_string(postgres_connection), + table_name, null="", columns=schema_columns, ) diff --git a/requirements.in b/requirements.in index 0657d57392b54..09b47a4c2aa95 100644 --- a/requirements.in +++ b/requirements.in @@ -55,7 +55,7 @@ pickleshare==0.7.5 Pillow==9.2.0 posthoganalytics==3.0.1 prance==0.22.2.22.0 -psycopg2-binary==2.8.6 +psycopg2-binary==2.9.7 pyarrow==12.0.1 pydantic==1.10.4 pyjwt==2.4.0 diff --git a/requirements.txt b/requirements.txt index 2190093813d3c..4fac42e90302a 100644 --- a/requirements.txt +++ b/requirements.txt @@ -321,7 +321,7 @@ protobuf==4.22.1 # grpcio-status # proto-plus # temporalio -psycopg2-binary==2.8.6 +psycopg2-binary==2.9.7 # via -r requirements.in ptyprocess==0.6.0 # via pexpect