Skip to content

docs(backup): expand restore variables inside the Postgres container - #962

Open
kobadaidesu wants to merge 1 commit into
BaaRai:mainfrom
kobadaidesu:docs/restore-compose-env
Open

kobadaidesu wants to merge 1 commit into
BaaRai:mainfrom
kobadaidesu:docs/restore-compose-env

Conversation

@kobadaidesu

Copy link
Copy Markdown

What

Update the restore examples in the README, docs/OPS.md and scripts/backup.sh --help to expand POSTGRES_USER and POSTGRES_DB inside the Postgres container. The help output also includes the second line of the command.

Why

With the standard Compose setup, both values are in .env. If you open a fresh shell and copy the restore command from the README, the host shell expands both variables to empty strings. On the stock Postgres image, psql then fails with FATAL: role "root" does not exist.

Size

  • At most 2,500 changed lines and 15 files.
  • Or a low-risk exception (localization files, documentation, generated code, test fixtures) up to 5,000 lines or 30 files, with the verification method described below.
  • Larger: I split it by subsystem, or I am asking for the current wave to park it.

Tests

  • Inserted one row, ran bash scripts/backup.sh, then used the README command to restore into an empty database with both variables unset on the host. On b53eccd8, psql exited 2 and the table was missing. With this change, SELECT note FROM operator_note returned the original value, before backup.
  • Checked bash scripts/backup.sh --help on macOS and Linux. Both printed the full restore command. Skipped the Go and web suites because only the examples and shell help changed.

Behavior change

Operators can copy the restore command into a fresh shell without exporting the database user and name first.

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.

1 participant