From f75c19a69a47fc2d32bc36a3d96ba31bc92cc7f1 Mon Sep 17 00:00:00 2001 From: Erik Johnston Date: Mon, 12 Oct 2026 19:04:46 +0000 Subject: [PATCH] Use engine-neutral placeholders in the port script's Postgres statements Two statements the port script runs against the Postgres store spelled their placeholders as psycopg2's `%s`, which the native Rust driver does not understand. `?` is what `LoggingTransaction` rewrites for whichever driver is in use. Co-Authored-By: Claude Fable 5.1 Claude-Session: https://claude.ai/code/session_01ULdieJyQoHNzeHq42H2M1p --- synapse/_scripts/synapse_port_db.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/synapse/_scripts/synapse_port_db.py b/synapse/_scripts/synapse_port_db.py index dcf71e515e..e9303c8b76 100755 --- a/synapse/_scripts/synapse_port_db.py +++ b/synapse/_scripts/synapse_port_db.py @@ -299,7 +299,7 @@ class Store( table, ", ".join(k for k in headers), "OVERRIDING SYSTEM VALUE" if override_system_value else "", - ", ".join("%s" for _ in headers), + ", ".join("?" for _ in headers), ) try: @@ -382,7 +382,7 @@ class Porter: def delete_all(txn: LoggingTransaction) -> None: txn.execute( - "DELETE FROM port_from_sqlite3 WHERE table_name = %s", (table,) + "DELETE FROM port_from_sqlite3 WHERE table_name = ?", (table,) ) txn.execute("TRUNCATE %s CASCADE" % (table,))