Update psycopg2 to latest version for complete PG 17 support

Update the types to match. Changes the cursor import to match the
C bindings[0].

Link: https://github.com/python/typeshed/issues/12578 [0]
Signed-off-by: Tristan Partin <tristan@neon.tech>
This commit is contained in:
Tristan Partin
2024-11-04 18:21:59 -06:00
committed by GitHub
parent 34812a6aab
commit 1e16221f82
4 changed files with 80 additions and 88 deletions

View File

@@ -23,9 +23,7 @@ def main(args: argparse.Namespace):
psconn: PgConnection = psycopg2.connect(pageserver_connstr)
psconn.autocommit = True
output = open(output_path, "wb")
with psconn.cursor() as pscur:
with open(output_path, "wb", encoding="utf-8") as output, psconn.cursor() as pscur:
pscur.copy_expert(f"basebackup {tenant_id} {timeline_id} {lsn}", output)