Skip to content

Commit 5fac7f9

Browse files
authored
Dev 18 sync (#1186)
* Fix server version request in basebackup.sh * Update bg_mon, pg_mon, pg_profile, pg_permissions refs * Install set_user, pg_permissions from pgdg
1 parent 38a4fa0 commit 5fac7f9

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

postgres-appliance/Dockerfile

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -55,12 +55,10 @@ ARG DEB_PG_SUPPORTED_VERSIONS="$PGOLDVERSIONS $PGVERSION"
5555
ENV POSTGIS_VERSION=3.6 \
5656
BG_MON_COMMIT=a73c6bcd10dfdf9feaf5eabab7eb6b12d167680d \
5757
PG_AUTH_MON_COMMIT=fe099eef7662cbc85b0b79191f47f52f1e96b779 \
58-
PG_MON_COMMIT=13c12eeb946dc2c5537139ce75432fa62b06f0eb \
59-
SET_USER=REL4_1_0 \
58+
PG_MON_COMMIT=88ac7b58348aa061c814982defc170644f368f39 \
6059
PLPROFILER=REL4_2_5 \
61-
PG_PROFILE=4.10 \
62-
PAM_OAUTH2=v1.0.1 \
63-
PG_PERMISSIONS_COMMIT=f4b7c18676fa64236a1c8e28d34a35764e4a70e2
60+
PG_PROFILE=4.11 \
61+
PAM_OAUTH2=v1.0.1
6462

6563
WORKDIR /builddeps
6664
RUN bash base.sh

postgres-appliance/build_scripts/base.sh

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,7 @@ fi
5353

5454
curl -sL "https://github.com/CyberDem0n/bg_mon/archive/$BG_MON_COMMIT.tar.gz" | tar xz
5555
curl -sL "https://github.com/zalando-pg/pg_auth_mon/archive/$PG_AUTH_MON_COMMIT.tar.gz" | tar xz
56-
curl -sL "https://github.com/cybertec-postgresql/pg_permissions/archive/$PG_PERMISSIONS_COMMIT.tar.gz" | tar xz
5756
curl -sL "https://github.com/zubkov-andrei/pg_profile/archive/$PG_PROFILE.tar.gz" | tar xz
58-
git clone -b "$SET_USER" https://github.com/pgaudit/set_user.git
5957

6058
apt-get install -y \
6159
postgresql-common \
@@ -124,6 +122,8 @@ for version in $DEB_PG_SUPPORTED_VERSIONS; do
124122
"postgresql-server-dev-${version}" \
125123
"postgresql-${version}-pgq3" \
126124
"postgresql-${version}-pg-stat-kcache" \
125+
"postgresql-${version}-pg-permissions" \
126+
"postgresql-${version}-set-user" \
127127
"${EXTRAS[@]}"
128128

129129
# Clean up timescaledb versions - keep at least 5 minor versions, but ensure compatibility with the lowest/oldest PG version (where possible)
@@ -183,8 +183,6 @@ for version in $DEB_PG_SUPPORTED_VERSIONS; do
183183

184184
for n in bg_mon-${BG_MON_COMMIT} \
185185
pg_auth_mon-${PG_AUTH_MON_COMMIT} \
186-
set_user \
187-
pg_permissions-${PG_PERMISSIONS_COMMIT} \
188186
pg_profile-${PG_PROFILE} \
189187
"${EXTRA_EXTENSIONS[@]}"; do
190188
PATH="/usr/lib/postgresql/$version/bin:$PATH" make -C "$n" USE_PGXS=1 clean

postgres-appliance/scripts/basebackup.sh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,10 @@ done
1919

2020
[[ -z $DATA_DIR || -z "$CONNSTR" || ! $RETRIES =~ ^[1-9]$ ]] && exit 1
2121

22+
if [[ ! $CONNSTR =~ dbname= ]]; then
23+
CONNSTR="${CONNSTR} dbname=postgres"
24+
fi
25+
2226
if which pg_receivewal &> /dev/null; then
2327
PG_RECEIVEWAL=pg_receivewal
2428
PG_BASEBACKUP_OPTS=(-X none)
@@ -95,7 +99,7 @@ else
9599
receivewal_pid=$(cat "$WAL_FAST/receivewal.pid")
96100
fi
97101

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)
99103
if [[ $PGVER -ge 15 ]]; then
100104
PG_BASEBACKUP_OPTS+=("--compress=server-lz4")
101105
fi

0 commit comments

Comments
 (0)