Skip to content

Add dbname=postgres to primary_conninfo for replication slot#65

Merged
souravbiswassanto merged 2 commits into
masterfrom
add-dbname-postgres-to-primary-conninfo-for-replication-slot
Jul 24, 2026
Merged

Add dbname=postgres to primary_conninfo for replication slot#65
souravbiswassanto merged 2 commits into
masterfrom
add-dbname-postgres-to-primary-conninfo-for-replication-slot

Conversation

@souravbiswassanto

Copy link
Copy Markdown
Member

Summary

  • Add dbname=postgres to the primary_conninfo parameter when WAL_LIMIT_POLICY is set to ReplicationSlot for PG 17 and 18
  • Ensures the standby connects to the postgres database for replication slot management

Changes

  • role_scripts/17/primary/start.sh: Add conditional dbname parameter
  • role_scripts/18/primary/start.sh: Add conditional dbname parameter
  • scripts/config_recovery.conf.sh: Add conditional dbname parameter

Why

When using replication slots for WAL limit policy, the connection needs to explicitly specify the postgres database to ensure proper replication slot functionality.

🤖 Generated with Claude Code

…t policy

When WAL_LIMIT_POLICY is set to ReplicationSlot, the primary_conninfo parameter now includes dbname=postgres. This ensures that the standby connects to the postgres database (not the configured POSTGRES_DB) for replication slot management, which is required for proper replication slot functionality in PG 17 and 18.

Changes:
- role_scripts/17/primary/start.sh: Add dbname=postgres when WAL_LIMIT_POLICY=ReplicationSlot
- role_scripts/18/primary/start.sh: Add dbname=postgres when WAL_LIMIT_POLICY=ReplicationSlot
- scripts/config_recovery.conf.sh: Add dbname=postgres when WAL_LIMIT_POLICY=ReplicationSlot

Signed-off-by: saurov@appscode.com
Signed-off-by: souravbiswassanto <sourav.cse4.bu@gmail.com>
…ation slot

When WAL_LIMIT_POLICY is set to ReplicationSlot, add dbname=postgres to primary_conninfo in standby initialization scripts. This ensures standbys also connect to the postgres database for proper replication slot management.

Changes:
- role_scripts/17/standby/run.sh: Add dbname=postgres when WAL_LIMIT_POLICY=ReplicationSlot
- role_scripts/18/standby/run.sh: Add dbname=postgres when WAL_LIMIT_POLICY=ReplicationSlot
- role_scripts/17/standby/remote-replica.sh: Add dbname=postgres when WAL_LIMIT_POLICY=ReplicationSlot
- role_scripts/18/standby/remote-replica.sh: Add dbname=postgres when WAL_LIMIT_POLICY=ReplicationSlot

Signed-off-by: saurov@appscode.com
Signed-off-by: souravbiswassanto <sourav.cse4.bu@gmail.com>
@souravbiswassanto
souravbiswassanto merged commit 7de36fb into master Jul 24, 2026
4 checks passed
@souravbiswassanto
souravbiswassanto deleted the add-dbname-postgres-to-primary-conninfo-for-replication-slot branch July 24, 2026 03:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant