The error “pg_replication_slots does not exist” typically occurs in pgAdmin when trying to query replication information. Here are the most common causes and solutions:

## 1. **Insufficient Privileges**
The most common cause is that your user doesn’t have permission to access the `pg_replication_slots` view.

**Solution:**
“`sql
— Connect as a superuser (like postgres) and grant access
GRANT SELECT ON pg_replication_slots TO your_username;
“`

## 2. **PostgreSQL Version**
`pg_replication_slots` was introduced in **PostgreSQL 9.4**. If you’re using an older version, this view won’t exist.

**Check your version:**
“`sql
SELECT version();
“`

**Alternative for older versions:**
– Upgrade PostgreSQL to 9.4 or later
– Use `pg_stat_replication` for basic replication info (available from 9.1+)

## 3. **Not Connected to Primary Server**
`pg_replication_slots` exists only on the **primary/master** server in a replication setup. If you’re connected to a replica/standby, this view won’t exist.

**Verify:**
“`sql
SELECT pg_is_in_recovery();

pgadmin pg_replication_slots does not exist

— Returns ‘f’ for primary, ‘t’ for standby
“`

## 4. **Replication Not Configured**
If replication isn’t configured at all, the view might not be populated but should still exist.

**Enable replication (if needed):**
1. Edit `postgresql.conf`:
“`
wal_level = replica
max_wal_senders = 10
max_replication_slots = 10
“`
2. Restart PostgreSQL

## 5. **Schema Issues**
Ensure you’re querying from the correct schema.

**Try with fully qualified name:**
“`sql
SELECT * FROM pg_catalog.pg_replication_slots;
“`

## 6. **pgAdmin Cache Issue**
Sometimes pgAdmin caches metadata incorrectly.

**Solution:**
1. Disconnect from the server in pgAdmin
2. Right-click → Refresh
3. Reconnect

## Quick Diagnostic Queries

“`sql
— Check if view exists
SELECT EXISTS (
SELECT FROM information_schema.tables
WHERE table_name = ‘pg_replication_slots’
);

— Check privileges
SELECT grantee, privilege_type
FROM information_schema.role_table_grants
WHERE table_name = ‘pg_replication_slots’;

— Check PostgreSQL version
SHOW server_version;
“`

## Most Likely Fix
If you’re on PostgreSQL 9.4+ and connected to a primary server, run this as a superuser:

“`sql
GRANT SELECT ON pg_replication_slots TO your_username;
“`

Then refresh pgAdmin’s connection or reconnect.

Share this post

Subscribe to our newsletter

Keep up with the latest blog posts by staying updated. No spamming: we promise.
By clicking Sign Up you’re confirming that you agree with our Terms and Conditions.