bgw_replstatus
bgw_replstatus : Small PostgreSQL background worker to report whether a node is a replication master or standby
Overview
| ID | Extension | Package | Version | Category | License | Language |
|---|---|---|---|---|---|---|
| 6510 | bgw_replstatus | bgw_replstatus | 1.0.8 |
STAT | PostgreSQL | C |
| Attribute | Has Binary | Has Library | Need Load | Has DDL | Relocatable | Trusted |
|---|---|---|---|---|---|---|
| --sL--- | No | Yes | Yes | No | no | no |
| Relationships | |
|---|---|
| See Also | repmgr pg_failover_slots pgautofailover pgpool_adm pglogical pgactive pglogical_ticker |
Packages
| Type | Repo | Version | PG Major Compatibility | Package Pattern | Dependencies |
|---|---|---|---|---|---|
| EXT | PGDG | 1.0.8 |
18 17 16 15 14 | bgw_replstatus |
- |
| RPM | PGDG | 1.0.8 |
18 17 16 15 14 | bgw_replstatus_$v |
- |
| DEB | PGDG | 1.0.8 |
18 17 16 15 14 | postgresql-$v-bgw-replstatus |
- |
| Linux / PG | PG18 | PG17 | PG16 | PG15 | PG14 |
|---|---|---|---|---|---|
| el8.x86_64 | PGDG 1.0.8 | PGDG 1.0.8 | PGDG 1.0.8 | PGDG 1.0.8 | PGDG 1.0.8 |
| el8.aarch64 | PGDG 1.0.8 | PGDG 1.0.8 | PGDG 1.0.8 | PGDG 1.0.8 | PGDG 1.0.8 |
| el9.x86_64 | PGDG 1.0.8 | PGDG 1.0.8 | PGDG 1.0.8 | PGDG 1.0.8 | PGDG 1.0.8 |
| el9.aarch64 | PGDG 1.0.8 | PGDG 1.0.8 | PGDG 1.0.8 | PGDG 1.0.8 | PGDG 1.0.8 |
| el10.x86_64 | PGDG 1.0.8 | PGDG 1.0.8 | PGDG 1.0.8 | PGDG 1.0.8 | PGDG 1.0.8 |
| el10.aarch64 | PGDG 1.0.8 | PGDG 1.0.8 | PGDG 1.0.8 | PGDG 1.0.8 | PGDG 1.0.8 |
| d12.x86_64 | PGDG 1.0.8 | PGDG 1.0.8 | PGDG 1.0.8 | PGDG 1.0.8 | PGDG 1.0.8 |
| d12.aarch64 | PGDG 1.0.8 | PGDG 1.0.8 | PGDG 1.0.8 | PGDG 1.0.8 | PGDG 1.0.8 |
| d13.x86_64 | PGDG 1.0.8 | PGDG 1.0.8 | PGDG 1.0.8 | PGDG 1.0.8 | PGDG 1.0.8 |
| d13.aarch64 | PGDG 1.0.8 | PGDG 1.0.8 | PGDG 1.0.8 | PGDG 1.0.8 | PGDG 1.0.8 |
| u22.x86_64 | PGDG 1.0.8 | PGDG 1.0.8 | PGDG 1.0.8 | PGDG 1.0.8 | PGDG 1.0.8 |
| u22.aarch64 | PGDG 1.0.8 | PGDG 1.0.8 | PGDG 1.0.8 | PGDG 1.0.8 | PGDG 1.0.8 |
| u24.x86_64 | PGDG 1.0.8 | PGDG 1.0.8 | PGDG 1.0.8 | PGDG 1.0.8 | PGDG 1.0.8 |
| u24.aarch64 | PGDG 1.0.8 | PGDG 1.0.8 | PGDG 1.0.8 | PGDG 1.0.8 | PGDG 1.0.8 |
| u26.x86_64 | PGDG 1.0.8 | PGDG 1.0.8 | PGDG 1.0.8 | PGDG 1.0.8 | PGDG 1.0.8 |
| u26.aarch64 | PGDG 1.0.8 | PGDG 1.0.8 | PGDG 1.0.8 | PGDG 1.0.8 | PGDG 1.0.8 |
Source
github.com/mhagander/bgw_replstatus
Install
Make sure PGDG repo available:
Install this extension with pig:
Config this extension to shared_preload_libraries:
This extension does not need CREATE EXTENSION DDL command
Usage
bgw_replstatus: lightweight replication status checker for load balancers
bgw_replstatus is a background worker that listens on a TCP port and immediately reports whether the node is a MASTER or STANDBY. Designed for load balancer health checks without requiring a full PostgreSQL connection.
How It Works
Any TCP connection to the configured port receives an immediate text response (MASTER or STANDBY) and the connection is closed. No request is needed.
Quick Test
HAProxy Configuration Example
Configuration
| Parameter | Default | Description |
|---|---|---|
bgw_replstatus.port |
5400 | TCP port to listen on |
bgw_replstatus.bind |
(wildcard) | IP address to bind to |
Security note: There is no source verification. Protect the port with a host firewall.