Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 3 additions & 7 deletions pgcopydb-helpers/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ GRANT SELECT ON ALL SEQUENCES IN SCHEMA public TO migration_user;

-- For future tables created before migration starts
ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT SELECT ON TABLES TO migration_user;

-- Prevent idle replication connection from being dropped during long COPY phases
ALTER ROLE migration_user SET wal_sender_timeout = 0;
```

Repeat the `GRANT USAGE`, `GRANT SELECT`, and `ALTER DEFAULT PRIVILEGES` statements for each schema being migrated.
Expand Down Expand Up @@ -75,13 +78,6 @@ You can verify logical replication is enabled on any platform with:
SHOW wal_level; -- should return 'logical'
```

**`wal_sender_timeout`:** Set this to `0` on the source to prevent the replication slot from being dropped during long COPY phases. The initial data copy can take hours on large databases, and the default timeout (60s) may cause PostgreSQL to drop the idle replication connection before CDC streaming begins.

```sql
ALTER SYSTEM SET wal_sender_timeout = 0;
SELECT pg_reload_conf();
```

### Target Database (PlanetScale)

- The target database must be created before starting the migration — pgcopydb does not create databases.
Expand Down