Automatic PostgREST retries for transient errors

Apr 20, 2026

All official Supabase client libraries now automatically retry failed database queries when they encounter transient network errors — no code changes required.

What changed#

When a GET or HEAD request to PostgREST fails with a transient error (HTTP 520, HTTP 503, or a network-level failure), the client transparently retries the request up to 3 times with exponential backoff (1s → 2s → 4s, capped at 30s). Each retry includes an X-Retry-Count header so server-side logs can observe retry behavior.

Only idempotent methods (GET and HEAD) are retried. POST, PATCH, PUT, and DELETE requests are never retried automatically.

Versions#

LibraryVersion
supabase-jsv2.102.0
supabase-swiftv2.43.0
supabase-flutter (postgrest_dart)v2.7.0 (supabase_flutter v2.12.2+)
supabase-pyv2.29.0

Configuration#

Retries are enabled by default. You can opt out globally or per-request:

JavaScript


_10
// Disable globally
_10
const supabase = createClient(url, key, {
_10
db: { retryEnabled: false }
_10
})
_10
_10
// Disable per request
_10
const { data } = await supabase.from('table').select().retry(false)

Swift


_10
// Disable globally
_10
let client = PostgrestClient(url: url, headers: headers, retryEnabled: false)
_10
_10
// Disable per request
_10
let data = try await client.from("table").select().retry(enabled: false).execute()

Flutter/Dart


_10
// Disable globally
_10
final client = PostgrestClient(url, retryEnabled: false);
_10
_10
// Disable per request
_10
final data = await supabase.from('table').select().retry(enabled: false);

Python


_10
# Disable per request
_10
data = supabase.table("table").select("*").retry(False).execute()

Build in a weekend, scale to millions