---
number: 45071
slug: 45071-automatic-postgrest-retries-for-transient-errors
published: 2026-04-20
discussion: https://github.com/orgs/supabase/discussions/45071
labels:
  - python
  - javascript
  - flutter
  - swift
page: https://supabase.com/changelog/45071-automatic-postgrest-retries-for-transient-errors
---

# Automatic PostgREST retries for transient errors

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

| Library | Version |
|---|---|
| [supabase-js](https://github.com/supabase/supabase-js) | `v2.102.0` |
| [supabase-swift](https://github.com/supabase/supabase-swift) | `v2.43.0` |
| [supabase-flutter](https://github.com/supabase/supabase-flutter) (postgrest_dart) | `v2.7.0` (supabase_flutter `v2.12.2`+) |
| [supabase-py](https://github.com/supabase/supabase-py) | `v2.29.0` |

### Configuration

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

**JavaScript**
```ts
// Disable globally
const supabase = createClient(url, key, {
  db: { retryEnabled: false }
})

// Disable per request
const { data } = await supabase.from('table').select().retry(false)
```

**Swift**
```swift
// Disable globally
let client = PostgrestClient(url: url, headers: headers, retryEnabled: false)

// Disable per request
let data = try await client.from("table").select().retry(enabled: false).execute()
```

**Flutter/Dart**
```dart
// Disable globally
final client = PostgrestClient(url, retryEnabled: false);

// Disable per request
final data = await supabase.from('table').select().retry(enabled: false);
```

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