We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 32fe3ca commit f6d8d00Copy full SHA for f6d8d00
postgres-appliance/scripts/basebackup.sh
@@ -19,6 +19,10 @@ done
19
20
[[ -z $DATA_DIR || -z "$CONNSTR" || ! $RETRIES =~ ^[1-9]$ ]] && exit 1
21
22
+if [[ ! $CONNSTR =~ dbname= ]]; then
23
+ CONNSTR="${CONNSTR} dbname=postgres"
24
+fi
25
+
26
if which pg_receivewal &> /dev/null; then
27
PG_RECEIVEWAL=pg_receivewal
28
PG_BASEBACKUP_OPTS=(-X none)
@@ -95,7 +99,7 @@ else
95
99
receivewal_pid=$(cat "$WAL_FAST/receivewal.pid")
96
100
fi
97
101
98
-PGVER=$(psql -d "$CONNSTR" -tAc "SELECT pg_catalog.current_setting('server_version_num')::int/10000" || echo 0)
102
+PGVER=$(psql "$CONNSTR" -tAc "SELECT pg_catalog.current_setting('server_version_num')::int/10000" || echo 0)
103
if [[ $PGVER -ge 15 ]]; then
104
PG_BASEBACKUP_OPTS+=("--compress=server-lz4")
105
0 commit comments