Use the PostgreSQL hook to backup my databases with borgmatic, so I don't have to dump them manually.
Steps to reproduce / actual behavior
Separate bugs, each with the repro and the observed behavior:
Dump backups when a database is configured with format "plain".
pg_restore: error: input file appears to be a text format dump. Please use psql.
Use shell commands with arguments within psql_command and pg_restore_command options.
These commands are executed without shell=True, so the subprocess
module treats e.g. docker exec my_pg_container psql as a single command
(resulting in Errno 2 "No such file or directory") instead of a command
with arguments.
psql shouldn't read ~/.psqlrc.
Some settings in user's ~/.psqlrc, e.g. linestyle unicode, may break the
CSV output. --no-psqlrc tells psql to not read this startup file.
This is not necessary for the analyze_command and restore_command (with
all_databases), but it's generally recommended when running psql from a
script.
PostgreSQL hook doesn't use the psql_command option for listing databse when dumping all.
Environment
Unknown. This ticket was created from commit messages in this PR: #677
#### What I'm trying to do and why
Use the PostgreSQL hook to backup my databases with borgmatic, so I don't have to dump them manually.
#### Steps to reproduce / actual behavior
Separate bugs, each with the repro and the observed behavior:
* Dump backups when a database is configured with format "plain".
```console
pg_restore: error: input file appears to be a text format dump. Please use psql.
```
* Use shell commands with arguments within `psql_command` and `pg_restore_command` options.
These commands are executed without `shell=True`, so the subprocess
module treats e.g. `docker exec my_pg_container psql` as a single command
(resulting in `Errno 2 "No such file or directory"`) instead of a command
with arguments.
* `psql` shouldn't read `~/.psqlrc`.
Some settings in user's `~/.psqlrc`, e.g. `linestyle unicode`, may break the
CSV output. `--no-psqlrc` tells `psql` to not read this startup file.
This is not necessary for the analyze_command and restore_command (with
all_databases), but it's generally recommended when running psql from a
script.
* PostgreSQL hook doesn't use the `psql_command` option for listing databse when dumping `all`.
#### Environment
Unknown. This ticket was created from commit messages in this PR: https://projects.torsion.org/borgmatic-collective/borgmatic/pulls/677
What I'm trying to do and why
Use the PostgreSQL hook to backup my databases with borgmatic, so I don't have to dump them manually.
Steps to reproduce / actual behavior
Separate bugs, each with the repro and the observed behavior:
psql_command
andpg_restore_command
options.These commands are executed without
shell=True
, so the subprocessmodule treats e.g.
docker exec my_pg_container psql
as a single command(resulting in
Errno 2 "No such file or directory"
) instead of a commandwith arguments.
psql
shouldn't read~/.psqlrc
.Some settings in user's
~/.psqlrc
, e.g.linestyle unicode
, may break theCSV output.
--no-psqlrc
tellspsql
to not read this startup file.This is not necessary for the analyze_command and restore_command (with
all_databases), but it's generally recommended when running psql from a
script.
psql_command
option for listing databse when dumpingall
.Environment
Unknown. This ticket was created from commit messages in this PR: #677
Fixed in main by @jirutka. Will be part of the next release.
This was just released in borgmatic 1.7.13!