Skip to content

PgPartman Support#10

Open
yknx4 wants to merge 3 commits into
planetscale:mainfrom
yknx4:main
Open

PgPartman Support#10
yknx4 wants to merge 3 commits into
planetscale:mainfrom
yknx4:main

Conversation

@yknx4

@yknx4 yknx4 commented Jun 9, 2026

Copy link
Copy Markdown

closes #9

This pull request introduces comprehensive support for multi-schema migrations and the pg_partman extension in the Heroku-to-PlanetScale migration workflow. It adds fine-grained schema inclusion/exclusion controls, ensures correct handling of generated columns and partitioned tables across schemas, and improves documentation and dashboard guidance for users migrating complex databases.

Multi-schema and pg_partman support:

  • Added MIGRATION_SCHEMAS and MIGRATION_EXCLUDE_SCHEMAS environment variables to allow users to specify which schemas to include or exclude during migration, defaulting to public and excluding common extension/internal schemas. The migrator now processes schemas accordingly throughout the migration process, including schema copy, Bucardo configuration, and generated column handling. (README.md, AGENTS.md, scripts/mk-bucardo-repl.sh) [1] [2] [3] [4] [5] [6]
  • Added explicit documentation and migration steps for supporting pg_partman, including instructions for pausing jobs, installing the extension, and manually applying generated SQL to recreate partition sets on PlanetScale. The dashboard now surfaces preflight information and SQL for pg_partman-managed tables. (README.md, AGENTS.md, status-server/dashboard.html) [1] [2] [3] [4]

Generated columns and schema-aware queries:

  • Updated all queries and scripts to handle schemas explicitly, ensuring generated columns and tables without primary keys are detected and processed across all included schemas, not just public. (AGENTS.md, scripts/mk-bucardo-repl.sh) [1] [2] [3] [4] [5] [6] [7]
  • Adjusted manual and automated steps for handling generated columns to use <schema>.<table> notation and to operate across all included schemas. (AGENTS.md, scripts/mk-bucardo-repl.sh) [1] [2] [3]

Operational improvements and configuration:

  • Added Bucardo runtime TCP keepalive settings to improve reliability of replication connections, especially for long-running migrations. (entrypoint.sh, scripts/mk-bucardo-repl.sh) [1] [2]
  • Enhanced migration and cutover steps to operate across all configured schemas, including correct SQL for revoking privileges and dropping triggers in all relevant schemas. (README.md, AGENTS.md) [1] [2]

Documentation and dashboard enhancements:

  • Updated documentation to reflect new multi-schema and pg_partman workflows, including environment variable usage, troubleshooting, and schema-aware examples. (README.md, AGENTS.md) [1] [2] [3]
  • Improved dashboard preflight checks to display pg_partman status, parent tables, and generated SQL for user action. (status-server/dashboard.html) [1] [2] [3]

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.

Failing with partman

1 participant