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

Update instructions to better match postgres-ng #100

Merged
merged 1 commit into from Mar 7, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 5 additions & 1 deletion backup-tools.sh
Expand Up @@ -64,7 +64,7 @@ cmd_restore() {
if [ "$PG_SUPERUSER_NAME" = "" ]; then
PG_SUPERUSER_NAME=postgres
fi
echo -n "Password (get this from the respective Kubernetes Secret): "
echo -n "Password (get this from the respective Kubernetes Secret or by exec'ing in the postgresql Pod and running: \`cat /postgres-password; echo\`): "
read -r PG_SUPERUSER_PASSWORD
if [ "$PG_SUPERUSER_PASSWORD" = "" ]; then
echo "ERROR: No password given." >&2
Expand All @@ -75,6 +75,10 @@ cmd_restore() {
PG_SUPERUSER_NAME_JSON="$(echo -n "$PG_SUPERUSER_NAME" | jq --raw-input --slurp .)"
PG_SUPERUSER_PASSWORD_JSON="$(echo -n "$PG_SUPERUSER_PASSWORD" | jq --raw-input --slurp .)"
do_curl POST "/v1/restore/${BACKUP_ID}" -d "{\"superuser\":{\"username\":$PG_SUPERUSER_NAME_JSON,\"password\":$PG_SUPERUSER_PASSWORD_JSON}}"

echo "If the restore was successful and you are using postgres-ng, you must now restart the postgresql pod to apply proper permissions!"
echo
echo "If the restore failed, check if any other pod is holding an active postgres connection and preventing the database from being dropped."
else
# when using the legacy postgres chart, this container uses the superuser
# credentials, so restore works directly
Expand Down