diff --git a/accountsdb-plugin-postgres/src/postgres_client/postgres_client_transaction.rs b/accountsdb-plugin-postgres/src/postgres_client/postgres_client_transaction.rs index 5aa7e27851..de52120040 100644 --- a/accountsdb-plugin-postgres/src/postgres_client/postgres_client_transaction.rs +++ b/accountsdb-plugin-postgres/src/postgres_client/postgres_client_transaction.rs @@ -488,7 +488,15 @@ impl SimplePostgresClient { ) -> Result { let stmt = "INSERT INTO transaction AS txn (signature, is_vote, slot, message_type, legacy_message, \ v0_loaded_message, signatures, message_hash, meta, updated_on) \ - VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10)"; + VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) \ + ON CONFLICT (slot, signature) DO UPDATE SET is_vote=excluded.is_vote, \ + message_type=excluded.message_type, \ + legacy_message=excluded.legacy_message, \ + v0_loaded_message=excluded.v0_loaded_message, \ + signatures=excluded.signatures, \ + message_hash=excluded.message_hash, \ + meta=excluded.meta, \ + updated_on=excluded.updated_on"; let stmt = client.prepare(stmt);