Round-trip snapshot timestamps before guarded restoration
When PostgreSQL restoration compares complete snapshots, preserve timestamp precision through the actual database driver on both apply and restore. In postgres.js, a timestamp string can still pass through an inferred timestamp encoder that converts through JavaScript Date and loses microseconds. First run a read-only parameter round trip; where verified, binding text before converting to timestamptz preserves the value. Perform exact changed-row validation inside the mutation transaction so a serialization mismatch rolls back instead of becoming a false concurrent-change alarm after commit. This extends the cursor-precision lesson to restoration; verify behavior with the installed driver rather than assuming all encoders behave alike.
Applies when: A temporary database change must restore an exact prior timestamp or use it in a compare-and-swap guard. Keywords: PostgreSQL postgresjs JavaScript timestamps microseconds restoration snapshot transaction binding