@@ -23,9 +23,6 @@ ENV WALG_VERSION=${WALG_VERSION:-3.0.3}
2323ARG PG_TIMETABLE_VERSION
2424ENV PG_TIMETABLE_VERSION=${PG_TIMETABLE_VERSION:-5.9.0}
2525
26- ARG SET_USER_VERSION
27- ENV SET_USER_VERSION=${SET_USER_VERSION:-REL4_1_0}
28-
2926ARG LOGERRORS_VERSION
3027ENV LOGERRORS_VERSION=${LOGERRORS_VERSION:-2.1.3}
3128
@@ -43,7 +40,7 @@ RUN apt-get clean && rm -rf /var/lib/apt/lists/partial \
4340 && apt-get update -o Acquire::CompressionTypes::Order::=gz \
4441 && apt-get install --no-install-recommends -y wget make gcc unzip sudo git \
4542 curl libc6-dev apt-transport-https ca-certificates pgxnclient bc \
46- build-essential libssl-dev krb5-multidev libkrb5-dev lsb-release apt-utils \
43+ build-essential libssl-dev krb5-multidev libkrb5-dev lsb-release apt-utils flex \
4744 && apt-get install --no-install-recommends -y postgresql-server-dev-${PG_SERVER_VERSION} \
4845 # plpython3 (procedural language implementation for Python 3.x)
4946 && apt-get install --no-install-recommends -y postgresql-plpython3-${PG_SERVER_VERSION} \
@@ -52,36 +49,37 @@ RUN apt-get clean && rm -rf /var/lib/apt/lists/partial \
5249 apt-get install --no-install-recommends -y postgresql-9.6-amcheck; \
5350 fi \
5451 # pg_repack extension
55- && apt-get install --no-install-recommends -y postgresql-${PG_SERVER_VERSION}-repack \
52+ && if [ $(echo "$PG_SERVER_VERSION < 17" | /usr/bin/bc) = "1" ]; then \
53+ apt-get install --no-install-recommends -y postgresql-${PG_SERVER_VERSION}-repack; \
54+ fi \
5655 # hypopg extension
5756 && apt-get install --no-install-recommends -y \
5857 postgresql-${PG_SERVER_VERSION}-hypopg \
5958 postgresql-${PG_SERVER_VERSION}-hypopg-dbgsym \
6059 # pgaudit extension
6160 && apt-get install --no-install-recommends -y postgresql-${PG_SERVER_VERSION}-pgaudit \
6261 # pg_hint_plan extension
63- && if [ $(echo "$PG_SERVER_VERSION < 17" | /usr/bin/bc) = "1" ]; then \
62+ && if [ $(echo "$PG_SERVER_VERSION > 11" | /usr/bin/bc) = "1" ] && [ $(echo "$PG_SERVER_VERSION < 17" | /usr/bin/bc) = "1" ]; then \
63+ apt-get install --no-install-recommends -y postgresql-${PG_SERVER_VERSION}-pg-hint-plan; \
64+ else \
6465 export PG_PLAN_HINT_VERSION=$(echo $PG_SERVER_VERSION | sed 's/\. //' ) \
65- && wget --quiet -O /tmp/pg_hint_plan.zip \
66- https://github.com/ossc-db/pg_hint_plan/archive/PG${PG_PLAN_HINT_VERSION}.zip \
66+ && wget --quiet -O /tmp/pg_hint_plan.zip https://github.com/ossc-db/pg_hint_plan/archive/PG${PG_PLAN_HINT_VERSION}.zip \
6767 && unzip /tmp/pg_hint_plan.zip -d /tmp \
6868 && cd /tmp/pg_hint_plan-PG${PG_PLAN_HINT_VERSION} \
6969 && make && make install; \
70- fi \
70+ fi \
7171 # powa extension
7272 && if [ $(echo "$PG_SERVER_VERSION < 17" | /usr/bin/bc) = "1" ]; then \
7373 apt-get install --no-install-recommends -y postgresql-${PG_SERVER_VERSION}-powa; \
7474 fi \
7575 # pg_auth_mon extension
76- && if [ $(echo "$PG_SERVER_VERSION < 16" | /usr/bin/bc) = "1" ]; then \
77- if [ "${PG_SERVER_VERSION}" = "9.6" ]; then \
78- cd /tmp && git clone --branch v1.0 --single-branch https://github.com/RafiaSabih/pg_auth_mon.git \
79- && cd pg_auth_mon && USE_PGXS=1 make && USE_PGXS=1 make install; \
80- elif [ $(echo "$PG_SERVER_VERSION > 10" | /usr/bin/bc) = "1" ]; then \
81- cd /tmp && git clone --branch v2.0 --single-branch https://github.com/RafiaSabih/pg_auth_mon.git \
82- && cd pg_auth_mon && USE_PGXS=1 make && USE_PGXS=1 make install; \
83- fi \
84- fi \
76+ && if [ "${PG_SERVER_VERSION}" = "9.6" ]; then \
77+ cd /tmp && git clone --branch v1.0 --single-branch https://github.com/RafiaSabih/pg_auth_mon.git \
78+ && cd pg_auth_mon && USE_PGXS=1 make && USE_PGXS=1 make install; \
79+ elif [ $(echo "$PG_SERVER_VERSION > 10" | /usr/bin/bc) = "1" ]; then \
80+ cd /tmp && git clone --branch v3.0 --single-branch https://github.com/RafiaSabih/pg_auth_mon.git \
81+ && cd pg_auth_mon && USE_PGXS=1 make && USE_PGXS=1 make install; \
82+ fi \
8583 # timescaledb extension
8684 && if [ $(echo "$PG_SERVER_VERSION > 11" | /usr/bin/bc) = "1" ] && [ $(echo "$PG_SERVER_VERSION < 17" | /usr/bin/bc) = "1" ]; then \
8785 echo "deb https://packagecloud.io/timescale/timescaledb/debian/ $(lsb_release -c -s) main" > /etc/apt/sources.list.d/timescaledb.list \
@@ -105,7 +103,7 @@ RUN apt-get clean && rm -rf /var/lib/apt/lists/partial \
105103 # hll extension
106104 && apt-get install --no-install-recommends -y postgresql-"${PG_SERVER_VERSION}" -hll \
107105 # topn extension
108- && if [ $(echo "$PG_SERVER_VERSION > 9.6" | /usr/bin/bc) = "1" ]; then \
106+ && if [ $(echo "$PG_SERVER_VERSION > 9.6" | /usr/bin/bc) = "1" ] && [ $(echo "$PG_SERVER_VERSION < 17" | /usr/bin/bc) = "1" ] ; then \
109107 curl -s https://install.citusdata.com/community/deb.sh | bash \
110108 && apt-get install --no-install-recommends -y postgresql-"${PG_SERVER_VERSION}" -topn; \
111109 fi \
@@ -115,43 +113,48 @@ RUN apt-get clean && rm -rf /var/lib/apt/lists/partial \
115113 && rm -rf pg_timetable_Linux_x86_64.deb \
116114 # pg_show_plans extension
117115 && if [ $(echo "$PG_SERVER_VERSION > 11" | /usr/bin/bc) = "1" ]; then \
118- cd /tmp && git clone https://github.com/cybertec-postgresql/pg_show_plans.git \
119- && cd pg_show_plans \
120- && export USE_PGXS=1 && make && make install; \
116+ apt-get install --no-install-recommends -y postgresql-${PG_SERVER_VERSION}-show-plans; \
121117 fi \
122118 # pg_cron extension
123119 && if [ $(echo "$PG_SERVER_VERSION > 9.6" | /usr/bin/bc) = "1" ] && [ $(echo "$PG_SERVER_VERSION < 16" | /usr/bin/bc) = "1" ]; then \
124120 cd /tmp && git clone --branch v${PG_CRON_VERSION} --single-branch https://github.com/citusdata/pg_cron.git \
125121 && cd pg_cron \
126122 && make && make install; \
127- elif [ "${PG_SERVER_VERSION}" = "9.6" ] || [ "$PG_SERVER_VERSION" = "16" ]; then \
123+ else \
128124 apt-get install --no-install-recommends -y postgresql-${PG_SERVER_VERSION}-cron; \
129125 fi \
130126 # postgresql_anonymizer extension
131127 && if [ $(echo "$PG_SERVER_VERSION > 9.6" | /usr/bin/bc) = "1" ]; then \
132128 pgxn install ddlx && pgxn install postgresql_anonymizer; \
133129 fi \
134130 # pg_stat_kcache extension
135- && apt-get install --no-install-recommends -y postgresql-${PG_SERVER_VERSION}-pg-stat-kcache \
136- # pg_wait_sampling extension
137131 && if [ $(echo "$PG_SERVER_VERSION < 17" | /usr/bin/bc) = "1" ]; then \
138- apt-get install --no-install-recommends -y postgresql-${PG_SERVER_VERSION}-pg-wait-sampling; \
132+ apt-get install --no-install-recommends -y postgresql-${PG_SERVER_VERSION}-pg-stat-kcache; \
133+ elif [ $(echo "$PG_SERVER_VERSION == 17" | /usr/bin/bc) = "1" ]; then \
134+ cd /tmp && git clone --branch REL2_3_0 https://github.com/powa-team/pg_stat_kcache.git \
135+ && cd pg_stat_kcache && make && make install; \
139136 fi \
137+ # pg_wait_sampling extension
138+ && apt-get install --no-install-recommends -y postgresql-${PG_SERVER_VERSION}-pg-wait-sampling \
140139 # pg_qualstats extension
141- && apt-get install --no-install-recommends -y postgresql-${PG_SERVER_VERSION}-pg-qualstats \
140+ && if [ $(echo "$PG_SERVER_VERSION < 17" | /usr/bin/bc) = "1" ]; then \
141+ apt-get install --no-install-recommends -y postgresql-${PG_SERVER_VERSION}-pg-qualstats; \
142+ fi \
142143 # bg_mon extension
143144 && apt-get install -y libevent-dev libbrotli-dev \
144145 && cd /tmp && git clone https://github.com/CyberDem0n/bg_mon.git && cd bg_mon \
145146 && USE_PGXS=1 make && USE_PGXS=1 make install && cd .. \
146147 # pgextwlist extension
147148 && apt-get install --no-install-recommends -y postgresql-${PG_SERVER_VERSION}-pgextwlist \
148149 # set_user extension
149- && if [ $(echo "$PG_SERVER_VERSION >= 12" | /usr/bin/bc) = "1" ]; then \
150- cd /tmp && git clone https://github.com/pgaudit/set_user.git \
151- && cd set_user && git checkout ${SET_USER_VERSION} && make USE_PGXS=1 && make USE_PGXS=1 install; \
152- elif [ $(echo "$PG_SERVER_VERSION < 12" | /usr/bin/bc) = "1" ]; then \
153- cd /tmp && git clone https://github.com/pgaudit/set_user.git \
154- && cd set_user && git checkout REL4_0_1 && make USE_PGXS=1 && make USE_PGXS=1 install; \
150+ && if [ $(echo "$PG_SERVER_VERSION > 9.6" | /usr/bin/bc) = "1" ] && [ $(echo "$PG_SERVER_VERSION < 17" | /usr/bin/bc) = "1" ]; then \
151+ apt-get install --no-install-recommends -y postgresql-${PG_SERVER_VERSION}-set-user; \
152+ elif [ $(echo "$PG_SERVER_VERSION == 17" | /usr/bin/bc) = "1" ]; then \
153+ cd /tmp && git clone --branch REL4_1_0 https://github.com/pgaudit/set_user.git \
154+ && cd set_user && make USE_PGXS=1 && make USE_PGXS=1 install; \
155+ elif [ $(echo "$PG_SERVER_VERSION == 9.6" | /usr/bin/bc) = "1" ]; then \
156+ cd /tmp && git clone --branch REL4_0_1 https://github.com/pgaudit/set_user.git \
157+ && cd set_user && make USE_PGXS=1 && make USE_PGXS=1 install; \
155158 fi \
156159 # logerrors extension
157160 && if [ $(echo "$PG_SERVER_VERSION > 9.6" | /usr/bin/bc) = "1" ]; then \
0 commit comments