Skip to content
Discussion options

You must be logged in to vote

For the migration runner, Supavisor session mode on the shared pooler’s port 5432 is the IPv4 alternative to a direct connection. It supports session-level advisory locks across transactions while the connection remains open. Transaction mode on port 6543 is unsuitable for that dependency. Supabase documents this in connection modes and session-state limitations.

There is also a client-side requirement: reserve one Postgres.js connection and run the lock, migration statements, and unlock through that reserved client. Using the general sql pool can select different sessions. sql.reserve() provides this. If the connection is lost, stop the migration attempt and reconcile what committed befo…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@ianjomar
Comment options

Answer selected by ianjomar
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants