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

Skipping certain schemas / tables during dump (Postgres) #324

Closed
knpwrs opened this issue Sep 30, 2022 · 3 comments
Closed

Skipping certain schemas / tables during dump (Postgres) #324

knpwrs opened this issue Sep 30, 2022 · 3 comments

Comments

@knpwrs
Copy link

knpwrs commented Sep 30, 2022

Is there a way to skip dumping certain schemas, tables, etc? I am using Postgraphile, and in development it creates a schema called postgraphile_watch and places a number of functions and other stuff there. This schema is only relevant to the local development process, not to other developers or to production environments. Is there a way to skip this schema during dump?

@amacneil
Copy link
Owner

amacneil commented Oct 1, 2022

I don't think so, but you could create a postgres user to run migrations that doesn't have access to that schema.

@knpwrs
Copy link
Author

knpwrs commented Oct 1, 2022

Interesting. Can you think of a clean way to bootstrap that as a part of the migration process, or would creating the roles and schemas be part of the infrastructure as code bootstrap process?

Right now, in development using Docker, I'm thinking I would have to use the /docker-entrypoint-initdb.d directory to set up the roles and schemas. Then depending on the target platform I would need to replicate that setup (it seems like Terraform has some Postgres providers that could handle this).

Does that make sense? Am I missing something that could make it simpler?

@knpwrs
Copy link
Author

knpwrs commented Oct 1, 2022

Well, this could be simpler: I only need the roles setup that way for development. In production I don't need the migration role to not have access to the postgraphile_watch schema because 1.) it won't exist and 2.) the dump won't matter in production anyway because it's only committed in development.

Thank you for the input!

@knpwrs knpwrs closed this as completed Oct 1, 2022
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