-
Notifications
You must be signed in to change notification settings - Fork 75
execute amcheck before doing backups #1032
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
Conversation
50fea81 to
bb9f502
Compare
|
b1e9cb9 to
a4474fa
Compare
|
Should we just create/enable amcheck as a default extension in our installations? |
We can do that, sure. Having it here made it easier to test the whole thing on an existing (old) box. |
ekohl
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just noting for myself: we don't need to install postgresql-contrib on external DBS because this check is only executed locally.
| def amcheck_installed? | ||
| sql = "select 'amcheck_installed' from pg_extension where extname='amcheck'" | ||
| result = query(sql) | ||
| !result.nil? && !result.empty? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should it check for the column we want to be present instead of just non-empty?
| !result.nil? && !result.empty? | |
| !result.nil? && result.include?('amcheck_installed') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right now result is something like [{"?column?"=>"amcheck_installed"}], so the include? would need to be a tad more smart, but it's really not necessary, as the result will be empty if the extensions is not there.
this ensures that the database is restorable or if it isn't (when there are index issues) the user knows at the time of the backup
this ensures that the database is restorable or if it isn't (when there are index issues) the user knows at the time of the backup