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

Use dbdrop and dbcreate before restoring a postgres dump #213

Merged
merged 1 commit into from Feb 21, 2024

Conversation

brunosedler
Copy link
Contributor

No description provided.

Copy link
Member

@codener codener left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Have you tried it locally?

Comment on lines +65 to +66
drop_command = 'dropdb --if-exists ' << config['database'].to_s
create_command = 'createdb ' << config['database'].to_s
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TIL!

However, dropdb and createdb have only been added in Postgres 12. This change will break restoring Postgres dumps for all folks on Postgres 11 and below. However, Postgres 11 apparently is EOL, so probably this is fine.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dropdb is shipped with postgresql-client package, so any postgres user should have it.

@brunosedler
Copy link
Contributor Author

LGTM. Have you tried it locally?

Yes, but not in a docker setup.

@brunosedler brunosedler merged commit caf6ecc into master Feb 21, 2024
3 checks passed
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.

None yet

2 participants