Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Question] Why not use pg_dump --schema-only to populate temporary database? #170

Open
aleclarson opened this issue Sep 4, 2024 · 3 comments

Comments

@aleclarson
Copy link

I've been facing some frustrating issues with the temporary database. Specifically, composite types aren't copied into it, leading to failed setup within assertValidPlan.

Instead of generating migration statements to setup the temporary database, we should dump every schema returned by fetchNamedSchemas and run those dump files on the temporary database.

@aleclarson
Copy link
Author

I'm going to add a --temp-db flag that pg-schema-diff will use instead of creating its own. This will allow me to workaround this issue in the meantime. Let me know if you'd like me to open a PR with that flag.

@Navbryce
Copy link

Navbryce commented Sep 4, 2024

I strongly recommend skipping plan validation (it's a flag). pg-schema-diff inherently relies on being to diff(empty db, your source db schema). So if your source db contains any schema objects that aren't supported, it will break

@Navbryce
Copy link

Navbryce commented Sep 4, 2024

It doesn't use pg_dump because many hosts don't have pg_dump or support for libpq. I'd be open to adding support it for hosts that have it installed.

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

No branches or pull requests

2 participants