Skip to content

Commit 1cac0e0

Browse files
committed
Add PG18, remove PG13
1 parent b4ffda5 commit 1cac0e0

File tree

8 files changed

+111
-107
lines changed

8 files changed

+111
-107
lines changed

delivery.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ allow_concurrent_steps: true
33

44
build_env: &BUILD_ENV
55
BASE_IMAGE: container-registry.zalando.net/library/ubuntu-22.04
6-
PGVERSION: 17
6+
PGVERSION: 18
77
MULTI_ARCH_REGISTRY: container-registry-test.zalando.net/acid
88

99
pipeline:

postgres-appliance/Dockerfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
ARG BASE_IMAGE=ubuntu:22.04
2-
ARG PGVERSION=17
2+
ARG PGVERSION=18
33
ARG DEMO=false
44
ARG COMPRESS=false
55
ARG ADDITIONAL_LOCALES=
@@ -46,14 +46,14 @@ ARG PGVERSION
4646
ARG TIMESCALEDB_APACHE_ONLY=true
4747
ARG TIMESCALEDB_TOOLKIT=true
4848
ARG COMPRESS
49-
ARG PGOLDVERSIONS="13 14 15 16"
49+
ARG PGOLDVERSIONS="14 15 16 17"
5050
ARG WITH_PERL=false
5151

5252
ARG DEB_PG_SUPPORTED_VERSIONS="$PGOLDVERSIONS $PGVERSION"
5353

5454
# Install PostgreSQL, extensions and contribs
5555
ENV POSTGIS_VERSION=3.6 \
56-
BG_MON_COMMIT=7f5887218790b263fe3f42f85f4ddc9c8400b154 \
56+
BG_MON_COMMIT=a73c6bcd10dfdf9feaf5eabab7eb6b12d167680d \
5757
PG_AUTH_MON_COMMIT=fe099eef7662cbc85b0b79191f47f52f1e96b779 \
5858
PG_MON_COMMIT=ead1de70794ed62ca1e34d4022f6165ff36e9a91 \
5959
SET_USER=REL4_1_0 \

postgres-appliance/bootstrap/maybe_pg_upgrade.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ def perform_pitr(postgresql, cluster_version, bin_version, config):
4040
except Exception:
4141
logs = tail_postgres_logs()
4242
# Spilo has no other locales except en_EN.UTF-8, therefore we are safe here.
43-
if int(cluster_version) >= 13 and 'recovery ended before configured recovery target was reached' in logs:
43+
if 'recovery ended before configured recovery target was reached' in logs:
4444
# Starting from version 13 Postgres stopped promoting when recovery target wasn't reached.
4545
# In order to improve the user experience we reset all possible recovery targets and retry.
4646
recovery_conf = config[config['method']].get('recovery_conf', {})

postgres-appliance/build_scripts/base.sh

Lines changed: 41 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ if [ "$WITH_PERL" != "true" ]; then
5151
equivs-build perl
5252
fi
5353

54-
curl -sL "https://github.com/zalando-pg/bg_mon/archive/$BG_MON_COMMIT.tar.gz" | tar xz
54+
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
5656
curl -sL "https://github.com/cybertec-postgresql/pg_permissions/archive/$PG_PERMISSIONS_COMMIT.tar.gz" | tar xz
5757
curl -sL "https://github.com/zubkov-andrei/pg_profile/archive/$PG_PROFILE.tar.gz" | tar xz
@@ -78,17 +78,11 @@ for version in $DEB_PG_SUPPORTED_VERSIONS; do
7878
"postgresql-${version}-dirtyread"
7979
"postgresql-${version}-extra-window-functions"
8080
"postgresql-${version}-first-last-agg"
81-
"postgresql-${version}-hll"
8281
"postgresql-${version}-hypopg"
83-
"postgresql-${version}-partman"
8482
"postgresql-${version}-plproxy"
8583
"postgresql-${version}-pgaudit"
86-
"postgresql-${version}-pldebugger"
87-
"postgresql-${version}-pglogical"
88-
"postgresql-${version}-pglogical-ticker"
8984
"postgresql-${version}-plpgsql-check"
9085
"postgresql-${version}-pg-checksums"
91-
"postgresql-${version}-pgl-ddl-deploy"
9286
"postgresql-${version}-pgq-node"
9387
"postgresql-${version}-postgis-${POSTGIS_VERSION%.*}"
9488
"postgresql-${version}-postgis-${POSTGIS_VERSION%.*}-scripts"
@@ -97,10 +91,16 @@ for version in $DEB_PG_SUPPORTED_VERSIONS; do
9791
"postgresql-${version}-decoderbufs"
9892
"postgresql-${version}-pllua"
9993
"postgresql-${version}-pgvector"
100-
"postgresql-${version}-roaringbitmap")
101-
102-
if [ "$version" -ge 14 ]; then
103-
EXTRAS+=("postgresql-${version}-pgfaceting")
94+
"postgresql-${version}-roaringbitmap"
95+
"postgresql-${version}-pgfaceting")
96+
97+
if [ "$version" != "18" ]; then
98+
EXTRAS+=("postgresql-${version}-hll"
99+
"postgresql-${version}-partman"
100+
"postgresql-${version}-pldebugger"
101+
"postgresql-${version}-pglogical"
102+
"postgresql-${version}-pglogical-ticker"
103+
"postgresql-${version}-pgl-ddl-deploy")
104104
fi
105105

106106
if [ "$WITH_PERL" = "true" ]; then
@@ -109,10 +109,13 @@ for version in $DEB_PG_SUPPORTED_VERSIONS; do
109109

110110
fi
111111

112-
if [ "${TIMESCALEDB_APACHE_ONLY}" = "true" ]; then
113-
EXTRAS+=("timescaledb-2-oss-postgresql-${version}")
114-
else
115-
EXTRAS+=("timescaledb-2-postgresql-${version}")
112+
if [ "$version" != "18" ]; then
113+
if [ "${TIMESCALEDB_APACHE_ONLY}" = "true" ]; then
114+
EXTRAS+=("timescaledb-2-oss-postgresql-${version}")
115+
else
116+
EXTRAS+=("timescaledb-2-postgresql-${version}")
117+
fi
118+
EXTRAS+=("postgresql-${version}-pg-stat-kcache")
116119
fi
117120

118121
# Install PostgreSQL binaries, contrib, plproxy and multiple pl's
@@ -123,35 +126,41 @@ for version in $DEB_PG_SUPPORTED_VERSIONS; do
123126
"postgresql-plpython3-${version}" \
124127
"postgresql-server-dev-${version}" \
125128
"postgresql-${version}-pgq3" \
126-
"postgresql-${version}-pg-stat-kcache" \
127129
"${EXTRAS[@]}"
128130

129131
# Clean up timescaledb versions except the last 5 minor versions
130-
exclude_patterns=()
131-
versions=$(find "/usr/lib/postgresql/$version/lib/" -name 'timescaledb-2.*.so' | sed -rn 's/.*timescaledb-([1-9]+\.[0-9]+\.[0-9]+)\.so$/\1/p' | sort -rV)
132-
latest_minor_versions=$(echo "$versions" | awk -F. '{print $1"."$2}' | uniq | head -n 5)
133-
for minor in $latest_minor_versions; do
134-
for full_version in $(echo "$versions" | grep "^$minor"); do
135-
exclude_patterns+=(! -name timescaledb-"${full_version}".so)
136-
exclude_patterns+=(! -name timescaledb-tsl-"${full_version}".so)
132+
if [ "$version" != "18" ]; then
133+
exclude_patterns=()
134+
versions=$(find "/usr/lib/postgresql/$version/lib/" -name 'timescaledb-2.*.so' | sed -rn 's/.*timescaledb-([1-9]+\.[0-9]+\.[0-9]+)\.so$/\1/p' | sort -rV)
135+
latest_minor_versions=$(echo "$versions" | awk -F. '{print $1"."$2}' | uniq | head -n 5)
136+
for minor in $latest_minor_versions; do
137+
for full_version in $(echo "$versions" | grep "^$minor"); do
138+
exclude_patterns+=(! -name timescaledb-"${full_version}".so)
139+
exclude_patterns+=(! -name timescaledb-tsl-"${full_version}".so)
140+
done
137141
done
138-
done
139-
find "/usr/lib/postgresql/$version/lib/" \( -name 'timescaledb-2.*.so' -o -name 'timescaledb-tsl-2.*.so' \) "${exclude_patterns[@]}" -delete
142+
find "/usr/lib/postgresql/$version/lib/" \( -name 'timescaledb-2.*.so' -o -name 'timescaledb-tsl-2.*.so' \) "${exclude_patterns[@]}" -delete
143+
fi
140144

141145
# Install 3rd party stuff
142146

143-
if [ "${TIMESCALEDB_APACHE_ONLY}" != "true" ] && [ "${TIMESCALEDB_TOOLKIT}" = "true" ]; then
144-
apt-get update
145-
if [ "$(apt-cache search --names-only "^timescaledb-toolkit-postgresql-${version}$" | wc -l)" -eq 1 ]; then
146-
apt-get install "timescaledb-toolkit-postgresql-$version"
147-
else
148-
echo "Skipping timescaledb-toolkit-postgresql-$version as it's not found in the repository"
147+
if [ "$version" != "18" ]; then
148+
if [ "${TIMESCALEDB_APACHE_ONLY}" != "true" ] && [ "${TIMESCALEDB_TOOLKIT}" = "true" ]; then
149+
apt-get update
150+
if [ "$(apt-cache search --names-only "^timescaledb-toolkit-postgresql-${version}$" | wc -l)" -eq 1 ]; then
151+
apt-get install "timescaledb-toolkit-postgresql-$version"
152+
else
153+
echo "Skipping timescaledb-toolkit-postgresql-$version as it's not found in the repository"
154+
fi
149155
fi
150156
fi
151157

152158
EXTRA_EXTENSIONS=()
153159
if [ "$DEMO" != "true" ]; then
154-
EXTRA_EXTENSIONS+=("plprofiler" "pg_mon-${PG_MON_COMMIT}")
160+
EXTRA_EXTENSIONS+=("plprofiler")
161+
if [ "$version" != "18" ]; then
162+
EXTRA_EXTENSIONS+=("pg_mon-${PG_MON_COMMIT}")
163+
fi
155164
fi
156165

157166
for n in bg_mon-${BG_MON_COMMIT} \

postgres-appliance/scripts/post_init.sh

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -142,13 +142,8 @@ CREATE TABLE IF NOT EXISTS public.postgres_log (
142142
CONSTRAINT postgres_log_check CHECK (false) NO INHERIT
143143
);
144144
GRANT SELECT ON public.postgres_log TO admin;"
145-
if [ "$PGVER" -ge 13 ]; then
146-
echo "ALTER TABLE public.postgres_log ADD COLUMN IF NOT EXISTS backend_type text;"
147-
fi
148-
if [ "$PGVER" -ge 14 ]; then
149-
echo "ALTER TABLE public.postgres_log ADD COLUMN IF NOT EXISTS leader_pid integer;"
150-
echo "ALTER TABLE public.postgres_log ADD COLUMN IF NOT EXISTS query_id bigint;"
151-
fi
145+
echo "ALTER TABLE public.postgres_log ADD COLUMN IF NOT EXISTS leader_pid integer;"
146+
echo "ALTER TABLE public.postgres_log ADD COLUMN IF NOT EXISTS query_id bigint;"
152147

153148
# Sunday could be 0 or 7 depending on the format, we just create both
154149
LOG_SHIP_HOURLY=$(echo "SELECT text(current_setting('log_rotation_age') = '1h')" | psql -tAX -d postgres 2> /dev/null | tail -n 1)

postgres-appliance/scripts/spilo_commons.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
# (min_version, max_version, shared_preload_libraries, extwlist.extensions)
1414
extensions = {
1515
'timescaledb': (9.6, 17, True, True),
16-
'pg_cron': (9.5, 17, True, False),
16+
'pg_cron': (9.5, 18, True, False),
1717
'pg_stat_kcache': (9.4, 17, True, False),
1818
'pg_partman': (9.4, 17, False, True)
1919
}

postgres-appliance/tests/docker-compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ services:
5050
postgresql:
5151
parameters:
5252
shared_buffers: 32MB
53-
PGVERSION: '13'
53+
PGVERSION: '14'
5454
# Just to test upgrade with clone. Without CLONE_SCOPE they don't work
5555
CLONE_WAL_S3_BUCKET: *bucket
5656
CLONE_AWS_ACCESS_KEY_ID: *access_key

0 commit comments

Comments
 (0)