pg_retry
Retry SQL statements on transient errors with exponential backoff
pg_retry : Retry SQL statements on transient errors with exponential backoff
Overview
| ID | Extension | Package | Version | Category | License | Language |
|---|---|---|---|---|---|---|
| 4100 | pg_retry | pg_retry | 1.0.0 |
UTIL | PostgreSQL | C |
| Attribute | Has Binary | Has Library | Need Load | Has DDL | Relocatable | Trusted |
|---|---|---|---|---|---|---|
| --s-d-r | No | Yes | No | Yes | yes | no |
| Relationships | |
|---|---|
| See Also | pg_task pg_durable pg_background pglock pg_later pg_dispatch pgmq ulak omni_worker pg_cron |
Packages
| Type | Repo | Version | PG Major Compatibility | Package Pattern | Dependencies |
|---|---|---|---|---|---|
| EXT | PIGSTY | 1.0.0 |
18 17 16 15 14 | pg_retry |
- |
| RPM | PIGSTY | 1.0.0 |
18 17 16 15 14 | pg_retry_$v |
- |
| DEB | PIGSTY | 1.0.0 |
18 17 16 15 14 | postgresql-$v-retry |
- |
| Linux / PG | PG18 | PG17 | PG16 | PG15 | PG14 |
|---|---|---|---|---|---|
| el8.x86_64 | PIGSTY 1.0.0 | PIGSTY 1.0.0 | N/A | N/A | N/A |
| el8.aarch64 | PIGSTY 1.0.0 | PIGSTY 1.0.0 | N/A | N/A | N/A |
| el9.x86_64 | PIGSTY 1.0.0 | PIGSTY 1.0.0 | N/A | N/A | N/A |
| el9.aarch64 | PIGSTY 1.0.0 | PIGSTY 1.0.0 | N/A | N/A | N/A |
| el10.x86_64 | PIGSTY 1.0.0 | PIGSTY 1.0.0 | N/A | N/A | N/A |
| el10.aarch64 | PIGSTY 1.0.0 | PIGSTY 1.0.0 | N/A | N/A | N/A |
| d12.x86_64 | PIGSTY 1.0.0 | PIGSTY 1.0.0 | N/A | N/A | N/A |
| d12.aarch64 | PIGSTY 1.0.0 | PIGSTY 1.0.0 | N/A | N/A | N/A |
| d13.x86_64 | PIGSTY 1.0.0 | PIGSTY 1.0.0 | N/A | N/A | N/A |
| d13.aarch64 | PIGSTY 1.0.0 | PIGSTY 1.0.0 | N/A | N/A | N/A |
| u22.x86_64 | PIGSTY 1.0.0 | PIGSTY 1.0.0 | N/A | N/A | N/A |
| u22.aarch64 | PIGSTY 1.0.0 | PIGSTY 1.0.0 | N/A | N/A | N/A |
| u24.x86_64 | PIGSTY 1.0.0 | PIGSTY 1.0.0 | N/A | N/A | N/A |
| u24.aarch64 | PIGSTY 1.0.0 | PIGSTY 1.0.0 | N/A | N/A | N/A |
| u26.x86_64 | PIGSTY 1.0.0 | PIGSTY 1.0.0 | N/A | N/A | N/A |
| u26.aarch64 | PIGSTY 1.0.0 | PIGSTY 1.0.0 | N/A | N/A | N/A |
Source
github.com/Agent-Hellboy/pg_retry
pg_retry-1.0.0.tar.gz
Install
Make sure PGDG and PIGSTY repo available:
Install this extension with pig:
Create this extension with:
Usage
pg_retry: Retry SQL statements on transient errors with exponential backoff
Function Signature
Default retryable SQLSTATEs: 40001 (serialization_failure), 40P01 (deadlock_detected), 55P03 (lock_not_available), 57014 (query_canceled).
Examples
Basic retry with defaults:
Custom retry parameters:
GUC Configuration
Safety Rules
- Only one SQL statement per call (multi-statement fails)
- Transaction control statements (BEGIN, COMMIT, ROLLBACK) are prohibited
- Parameters are validated (max_tries >= 1, non-negative delays, base <= max delay)