From 8700d9a497dd01823a37d269b39cc57e443929de Mon Sep 17 00:00:00 2001 From: Vitaliy Kukharik Date: Fri, 22 Jul 2022 21:50:55 +0000 Subject: [PATCH] update PostgreSQL extensions --- README.md | 173 ++++++++++++++------------------ extended-postgres/Dockerfile | 187 ++++++++++++++++++++--------------- 2 files changed, 182 insertions(+), 178 deletions(-) diff --git a/README.md b/README.md index b6d4c0f..a90f85a 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ PostgreSQL Docker images with various additional extensions. Includes the majori Derived from [official PostgreSQL images](https://hub.docker.com/_/postgres). One of the key differences is that PostgreSQL can be stopped or restarted without the container being stopped (this is because in the official image, the `postmaster` process is the main one). -Storage-optimized: the size of each image is just ~120 MiB. +Storage-optimized: the size of each image is ~300-500 MiB. Use these images with Database Lab, when you need HypoPG or anything else. @@ -33,116 +33,89 @@ Available PostgreSQL versions: 9.6, 10, 11, 12, 13, 14. Extensions: - [set_user](https://github.com/pgaudit/set_user) - [Timescale](https://github.com/timescale/timescaledb) -#### Not included in the PostgreSQL 13 image (yet) -The PostgreSQL 13 image is now missing the following extensions (they will be added in the future): -- bg_mon -- pg_auth_mon -- powa - #### Not included in the PostgreSQL 14 image (yet) The PostgreSQL 14 image is now missing the following extensions (they will be added in the future): -- bg_mon - pg_auth_mon -- pg_hint_plan -- powa -- timescaledb ### How to extend - You can fork this repository and extend `Dockerfile`, then build your own images - Proposals to add more extensions to this repository are welcome https://gitlab.com/postgres-ai/custom-images/-/issues ### The complete list of available extensions -| name | version | comment | -| --- | --- | --- | -| adminpack | 2.0 | administrative functions for PostgreSQL | -| amcheck | 1.1 | functions for verifying relation integrity | -| anon | 0.6.0 | Data anonymization tools | -| autoinc | 1.0 | functions for autoincrementing fields | -| bloom | 1.0 | bloom access method - signature file based index | -| btree_gin | 1.3 | support for indexing common datatypes in GIN | -| btree_gist | 1.5 | support for indexing common datatypes in GiST | -| citext | 1.5 | data type for case-insensitive character strings | -| citus | 9.4-1 | Citus distributed database | -| cube | 1.4 | data type for multidimensional cubes | -| dblink | 1.2 | connect to other PostgreSQL databases from within a database | -| ddlx | 0.16 | DDL eXtractor functions | -| dict_int | 1.0 | text search dictionary template for integers | -| dict_xsyn | 1.0 | text search dictionary template for extended synonym processing | -| earthdistance | 1.1 | calculate great-circle distances on the surface of the Earth | -| file_fdw | 1.0 | foreign-data wrapper for flat file access | -| fuzzystrmatch | 1.1 | determine similarities and distance between strings | -| hll | 2.14 | type for storing hyperloglog data | -| hstore | 1.5 | data type for storing sets of (key, value) pairs | -| hypopg | 1.1.3 | Hypothetical indexes for PostgreSQL | -| insert_username | 1.0 | functions for tracking who changed a table | -| intagg | 1.1 | integer aggregator and enumerator (obsolete) | -| intarray | 1.2 | functions, operators, and index support for 1-D arrays of integers | -| isn | 1.2 | data types for international product numbering standards | -| lo | 1.1 | Large Object maintenance | -| logerrors | 2.0 | Function for collecting statistics about messages in logfile -| ltree | 1.1 | data type for hierarchical tree-like structures | -| moddatetime | 1.0 | functions for tracking last modification time | -| pageinspect | 1.7 | inspect the contents of database pages at a low level | -| pg_auth_mon | 1.0 | monitor connection attempts per user | -| pg_buffercache | 1.3 | examine the shared buffer cache | -| pg_cron | 1.2 | Job scheduler for PostgreSQL | -| pg_freespacemap | 1.2 | examine the free space map (FSM) | -| pg_hint_plan | 1.3.6 | | -| pg_prewarm | 1.2 | prewarm relation data | -| pg_qualstats | 2.0.2 | An extension collecting statistics about quals | -| pg_repack | 1.4.5 | Reorganize tables in PostgreSQL databases with minimal locks | -| pg_show_plans | 1.0 | show query plans of all currently running SQL statements | -| pg_stat_kcache | 2.1.3 | Kernel statistics gathering | -| pg_wait_sampling | 1.1.3 | sampling based statistics of wait events | -| pg_stat_statements | 1.6 | track execution statistics of all SQL statements executed | -| pg_trgm | 1.4 | text similarity measurement and index searching based on trigrams | -| pg_visibility | 1.2 | examine the visibility map (VM) and page-level visibility info | -| pgaudit | 1.3.2 | provides auditing functionality | -| pgcrypto | 1.3 | cryptographic functions | -| pgrowlocks | 1.2 | show row-level locking information | -| pgstattuple | 1.5 | show tuple-level statistics | -| plpgsql | 1.0 | PL/pgSQL procedural language | -| postgres_fdw | 1.0 | foreign-data wrapper for remote PostgreSQL servers | -| powa | 4.0.1 | PostgreSQL Workload Analyser-core | -| refint | 1.0 | functions for implementing referential integrity (obsolete) | -| seg | 1.3 | data type for representing line segments or floating-point intervals | -| set_user | 3.0 | similar to SET ROLE but with added logging | -| sslinfo | 1.2 | information about SSL certificates | -| tablefunc | 1.0 | functions that manipulate whole tables, including crosstab | -| tcn | 1.0 | Triggered change notifications | -| timescaledb | 1.7.2 | Enables scalable inserts and complex queries for time-series data | -| timetravel | 1.0 | functions for implementing time travel | -| topn | 2.3.0 | type for top-n JSONB | -| tsm_system_rows | 1.0 | TABLESAMPLE method which accepts number of rows as a limit | -| tsm_system_time | 1.0 | TABLESAMPLE method which accepts time in milliseconds as a limit | -| unaccent | 1.1 | text search dictionary that removes accents | -| uuid-ossp | 1.1 | generate universally unique identifiers (UUIDs) | -| xml2 | 1.1 | XPath querying and XSLT | +| name | version
(9.6) | version
(10) | version
(11) | version
(12) | version
(13) | version
(14) | comment | +| --- | --- | --- | --- | --- | --- | --- | --- | +| adminpack | 1.1 | 1.1 | 2.0 | 2.0 | 2.1 | 2.1 | administrative functions for PostgreSQL | +| amcheck | 2 | 1.0 | 1.1 | 1.2 | 1.2 | 1.3 | functions for verifying relation integrity. ("amcheck_next" for Postgres 9.6) | +| anon | 1.0.0 | 1.0.0 | 1.0.0 | 1.0.0 | 1.0.0 | 1.0.0 | Data anonymization tools | +| autoinc | 1.0 | 1.0 | 1.0 | 1.0 | 1.0 | 1.0 | functions for autoincrementing fields | +| bloom | 1.0 | 1.0 | 1.0 | 1.0 | 1.0 | 1.0 | bloom access method - signature file based index | +| btree_gin | 1.0 | 1.2 | 1.3 | 1.3 | 1.3 | 1.3 | support for indexing common datatypes in GIN | +| btree_gist | 1.2 | 1.5 | 1.5 | 1.5 | 1.5 | 1.6 | support for indexing common datatypes in GiST | +| citext | 1.3 | 1.4 | 1.5 | 1.6 | 1.6 | 1.6 | data type for case-insensitive character strings | +| citus | 8.0 | 8.3 | 10.0 | 10.2 | 11.0 | 11.0 | Citus distributed database | +| cube | 1.2 | 1.2 | 1.4 | 1.4 | 1.4 | 1.5 | data type for multidimensional cubes | +| dblink | 1.2 | 1.2 | 1.2 | 1.2 | 1.2 | 1.2 | connect to other PostgreSQL databases from within a database | +| ddlx | 0.22 | 0.22 | 0.22 | 0.22 | 0.22 | 0.22 | DDL eXtractor functions | +| dict_int | 1.0 | 1.0 | 1.0 | 1.0 | 1.0 | 1.0 | text search dictionary template for integers | +| dict_xsyn | 1.0 | 1.0 | 1.0 | 1.0 | 1.0 | 1.0 | text search dictionary template for extended synonym processing | +| earthdistance | 1.1 | 1.1 | 1.1 | 1.1 | 1.1 | 1.1 | calculate great-circle distances on the surface of the Earth | +| file_fdw | 1.0 | 1.0 | 1.0 | 1.0 | 1.0 | 1.0 | foreign-data wrapper for flat file access | +| fuzzystrmatch | 1.1 | 1.1 | 1.1 | 1.1 | 1.1 | 1.1 | determine similarities and distance between strings | +| hll | 2.16 | 2.1 | 2.16 | 2.16 | 2.16 | 2.16 | type for storing hyperloglog data | +| hstore | 1.4 | 1.4 | 1.5 | 1.6 | 1.7 | 1.8 | data type for storing sets of (key, value) pairs | +| hstore_plpython3u | 1.0 | 1.0 | 1.0 | 1 .0 | 1.0 | 1.0 | transform between hstore and plpython3u | +| hypopg | 1.3.1 | 1.3.1 | 1.3.1 | 1.3.1 | 1.3.1 | 1.3.1 | Hypothetical indexes for PostgreSQL | +| insert_username | 1.0 | 1.0 | 1.0 | 1.0 | 1.0 | 1.0 | functions for tracking who changed a table | +| intagg | 1.1 | 1.1 | 1.1 | 1.1 | 1.1 | 1.1 | integer aggregator and enumerator (obsolete) | +| intarray | 1.2 | 1.2 | 1.2 | 1.2 | 1.3 | 1.5 | functions, operators, and index support for 1-D arrays of integers | +| isn | 1.1 | 1.1 | 1.2 | 1.2 | 1.2 | 1.2 | data types for international product numbering standards | +| jsonb_plpython3u | | | 1.0 | 1.0 | 1.0 | 1.0 | transform between jsonb and plpython3u | +| lo | 1.1 | 1.1 | 1.1 | 1.1 | 1.1 | 1.1 | Large Object maintenance | +| logerrors | | 2.0 | 2.0 | 2.0 | 2.0 | 2.0 | Function for collecting statistics about messages in logfile +| ltree | 1.1 | 1.1 | 1.1 | 1.1 | 1.2 | 1.2 | data type for hierarchical tree-like structures | +| ltree_plpython3u | 1.0 | 1.0 | 1.0 | 1.0 | 1.0 | 1.0 | transform between ltree and plpython3u | +| moddatetime | 1.0 | 1.0 | 1.0 | 1.0 | 1.0 | 1.0 | functions for tracking last modification time | +| moddatetime | 1.0 | 1.0 | 1.0 | 1.0 | 1.0 | 1.0 | functions for tracking last modification time | +| old_snapshot | | | | | | 1.0 | iutilities in support of old_snapshot_threshold | +| pg_auth_mon | 1.1 | 1.1 | 1.1 | 1.1 | 1.1 | | monitor connection attempts per user | +| pg_buffercache | 1.2 | 1.3 | 1.3 | 1.3 | 1.3 | 1.3 | examine the shared buffer cache | +| pg_cron | 1.4 | 1.4 | 1.4 | 1.4 | 1.4 | 1.4 | Job scheduler for PostgreSQL | +| pg_freespacemap | 1.1 | 1.2 | 1.2 | 1.2 | 1.2 | 1.2 | examine the free space map (FSM) | +| pg_hint_plan | 1.2.7 | 1.3.6 | 1.3.7 | 1.3.7 | 1.3.7 | 1.4 | makes it possible to tweak PostgreSQL execution plans using so-called "hints" in SQL comments | +| pg_prewarm | 1.1 | 1.1 | 1.2 | 1.2 | 1.2 | 1.2 | prewarm relation data | +| pg_qualstats | 2.0.3 | 2.0.4 | 2.0.4 | 2.0.4 | 2.0.4 | 2.0.4 | An extension collecting statistics about quals | +| pg_repack | 1.4.7 | 1.4.7 | 1.4.7 | 1.4.7 | 1.4.7 | 1.4.7 | Reorganize tables in PostgreSQL databases with minimal locks | +| pg_show_plans | 1.0 | 1.0 | 1.0 | 1.0 | 1.0 | 1.0 | show query plans of all currently running SQL statements | +| pg_stat_kcache | 2.2.0 | 2.2.1 | 2.2.1 | 2.2.1 | 2.2.1 | 2.2.1 | Kernel statistics gathering | +| pg_wait_sampling | 1.1 | 1.1 | 1.1 | 1.1 | 1.1 | 1.1 | sampling based statistics of wait events | +| pg_stat_statements | 1.4 | 1.6 | 1.6 | 1.7 | 1.8 | 1.9 | track execution statistics of all SQL statements executed | +| pg_surgery | | | | | | 1.0 | extension to perform surgery on a damaged relation | +| pg_trgm | 1.3 | 1.3 | 1.4 | 1.4 | 1.5 | 1.6 | text similarity measurement and index searching based on trigrams | +| pg_visibility | 1.1 | 1.2 | 1.2 | 1.2 | 1.2 | 1.2 | examine the visibility map (VM) and page-level visibility info | +| pgaudit | 1.1.4 | 1.2.4 | 1.3.4 | 1.4.3 | 1.5.2 | 1.6.2 | provides auditing functionality | +| pgcrypto | 1.3 | 1.3 | 1.3 | 1.3 | 1.3 | 1.3 | cryptographic functions | +| pgrowlocks | 1.2 | 1.2 | 1.2 | 1.2 | 1.2 | 1.2 | show row-level locking information | +| pgstattuple | 1.4 | 1.5 | 1.5 | 1.5 | 1.5 | 1.5 | show tuple-level statistics | +| plpgsql | 1.0 | 1.0 | 1.0 | 1.0 | 1.0 | 1.0 | PL/pgSQL procedural language | +| plpython3u | 1.0 | 1.0 | 1.0 | 1.0 | 1.0 | 1.0 | PL/Python3U untrusted procedural language | +| postgres_fdw | 1.0 | 1.0 | 1.0 | 1.0 | 1.0 | 1.1 | foreign-data wrapper for remote PostgreSQL servers | +| powa | 4.1.2 | 4.1.4 | 4.1.4 | 4.1.4 | 4.1.4 | 4.1.4 | PostgreSQL Workload Analyser-core | +| refint | 1.0 | 1.0 | 1.0 | 1.0 | 1.0 | 1.0 | functions for implementing referential integrity (obsolete) | +| seg | 1.1 | 1.1 | 1.3 | 1.3 | 1.3 | 1.4 | data type for representing line segments or floating-point intervals | +| set_user | 3.0 | 3.0 | 3.0 | 3.0 | 3.0 | 3.0 | similar to SET ROLE but with added logging | +| sslinfo | 1.2 | 1.2 | 1.2 | 1.2 | 1.2 | 1.2 | information about SSL certificates | +| tablefunc | 1.0 | 1.0 | 1.0 | 1.0 | 1.0 | 1.0 | functions that manipulate whole tables, including crosstab | +| tcn | 1.0 | 1.0 | 1.0 | 1.0 | 1.0 | 1.0 | Triggered change notifications | +| timescaledb | 1.7.5 | 1.7.5 | 2.3.1 | 2.7.1 | 2.7.1 | 2.7.1 | Enables scalable inserts and complex queries for time-series data | +| timetravel | 1.0 | 1.0 | 1.0 | | | | functions for implementing time travel | +| topn | 2.3.0 | 2.3.0 | 2.4.0 | 2.4.0 | 2.4.0 | 2.4.0 | type for top-n JSONB | +| tsm_system_rows | 1.0 | 1.0 | 1.0 | 1.0 | 1.0 | 1.0 | TABLESAMPLE method which accepts number of rows as a limit | +| tsm_system_time | 1.0 | 1.0 | 1.0 | 1.0 | 11.0 | 1.0 | TABLESAMPLE method which accepts time in milliseconds as a limit | +| unaccent | 1.1 | 1.1 | 1.1 | 1.1 | 1.1 | 1.1 | text search dictionary that removes accents | +| uuid-ossp | 1.1 | 1.1 | 1.1 | 1.1 | 1.1 | 1.1 | generate universally unique identifiers (UUIDs) | +| xml2 | 1.1 |1.1 | 1.1 | 1.1 | 1.1 | 1.1 | XPath querying and XSLT | ### PostgreSQL Tools: - [WAL-G](https://github.com/wal-g/wal-g) - [pgBackRest](https://github.com/pgbackrest/pgbackrest) -## Sync Instance images - -**Deprecated. Use the extended image instead.** - -PostgreSQL Docker images with WAL-G. - -Available versions: 9.6, 10, 11, 12, and 13. - -Use these images when you need set up a replica fetching WAL archives from an S3-compatible storage. - -Example of sync instance usage with backups in Google Cloud Storage: -```bash -docker run \ - --name sync-instance \ - --env PGDATA=/var/lib/postgresql/pgdata \ - --env WALG_GS_PREFIX="gs://{BUCKET}/{SCOPE}" \ - --env GOOGLE_APPLICATION_CREDENTIALS="/etc/sa/credentials.json" \ - --volume /home/service_account.json:/etc/sa/credentials.json \ - --volume /var/lib/dblab/data:/var/lib/postgresql/pgdata:rshared \ - --detach \ - postgresai/sync-instance:13 -``` -See the full list of configuration options in the [WAL-G project](https://github.com/wal-g/wal-g#configuration) repo. diff --git a/extended-postgres/Dockerfile b/extended-postgres/Dockerfile index 18c99f8..9d33637 100644 --- a/extended-postgres/Dockerfile +++ b/extended-postgres/Dockerfile @@ -40,39 +40,60 @@ ENV PG_SERVER_VERSION=${PG_SERVER_VERSION:-14} ARG PGBR_VERSION ENV PGBR_VERSION=${PGBR_VERSION:-2.39} +ARG PG_TIMETABLE_VERSION +ENV PG_TIMETABLE_VERSION=${PG_TIMETABLE_VERSION:-4.8.0} + RUN apt-get clean && rm -rf /var/lib/apt/lists/partial \ + # add the backports repository for Debian 9 Stretch. Required to install the package "libbrotli-dev" + && if [ $(sed 's/\..*//' /etc/debian_version) = "9" ]; then \ + echo "deb http://deb.debian.org/debian stretch-backports main" > /etc/apt/sources.list.d/backports.list; \ + fi \ && apt-get update -o Acquire::CompressionTypes::Order::=gz \ && apt-get install --no-install-recommends -y wget make gcc unzip sudo git \ curl libc6-dev apt-transport-https ca-certificates pgxnclient bc \ - build-essential libevent-dev libssl-dev krb5-multidev libkrb5-dev lsb-release apt-utils \ + build-essential libssl-dev krb5-multidev libkrb5-dev lsb-release apt-utils \ && apt-get install --no-install-recommends -y \ postgresql-server-dev-${PG_SERVER_VERSION} \ - && apt-get install --no-install-recommends -y postgresql-${PG_SERVER_VERSION}-repack \ + # plpython3 (procedural language implementation for Python 3.x) && apt-get install --no-install-recommends -y \ postgresql-plpython3-${PG_SERVER_VERSION} \ - # hypopg + # amcheck extension; not included in contrib for Postgres 9.6 + && if [ "${PG_SERVER_VERSION}" = "9.6" ]; then \ + apt-get install --no-install-recommends -y \ + postgresql-9.6-amcheck; \ + fi \ + # pg_repack extension && apt-get install --no-install-recommends -y \ - postgresql-${PG_SERVER_VERSION}-hypopg \ + postgresql-${PG_SERVER_VERSION}-repack \ + # hypopg extension && apt-get install --no-install-recommends -y \ + postgresql-${PG_SERVER_VERSION}-hypopg \ postgresql-${PG_SERVER_VERSION}-hypopg-dbgsym \ # pgaudit extension - && apt-get install --no-install-recommends -y postgresql-${PG_SERVER_VERSION}-pgaudit \ + && apt-get install --no-install-recommends -y \ + postgresql-${PG_SERVER_VERSION}-pgaudit \ + # pg_hint_plan extension && if [ $(echo "$PG_SERVER_VERSION < 14" | /usr/bin/bc) = "1" ]; then \ - # pg_hint_plan extension (dots are to be skipped here, e.g., "9.6" -> "96") export PG_PLAN_HINT_VERSION=$(echo $PG_SERVER_VERSION | sed 's/\.//') \ && wget --quiet -O /tmp/pg_hint_plan.zip \ https://github.com/ossc-db/pg_hint_plan/archive/PG${PG_PLAN_HINT_VERSION}.zip \ && unzip /tmp/pg_hint_plan.zip -d /tmp \ && cd /tmp/pg_hint_plan-PG${PG_PLAN_HINT_VERSION} \ && make && make install; \ - fi \ - # extensions supported in PostgreSQL 12 and below - # bc is used to manage PostgreSQL versions with dot like 9.6 - && if [ $(echo "$PG_SERVER_VERSION < 13" | /usr/bin/bc) = "1" ]; then \ - # powa extension - apt-get install postgresql-${PG_SERVER_VERSION}-powa \ - # pg_auth_mon extension - && git clone https://github.com/RafiaSabih/pg_auth_mon.git \ + # there is no branch "PG14", use the tag "REL14_1_4_0" + elif [ "${PG_SERVER_VERSION}" = "14" ]; then \ + wget --quiet -O /tmp/pg_hint_plan.zip \ + https://github.com/ossc-db/pg_hint_plan/archive/REL14_1_4_0.zip \ + && unzip /tmp/pg_hint_plan.zip -d /tmp \ + && cd /tmp/pg_hint_plan-REL14_1_4_0 \ + && make && make install; \ + fi \ + # powa extension + && apt-get install --no-install-recommends -y \ + postgresql-${PG_SERVER_VERSION}-powa \ + # pg_auth_mon extension + && if [ $(echo "$PG_SERVER_VERSION < 14" | /usr/bin/bc) = "1" ]; then \ + git clone https://github.com/RafiaSabih/pg_auth_mon.git \ && cd pg_auth_mon && USE_PGXS=1 make && USE_PGXS=1 make install; \ fi \ # timescaledb extension @@ -82,74 +103,84 @@ RUN apt-get clean && rm -rf /var/lib/apt/lists/partial \ 'main' > /etc/apt/sources.list.d/timescaledb.list \ && wget --quiet -O - https://packagecloud.io/timescale/timescaledb/gpgkey | sudo apt-key add - \ && apt-get update \ - && apt-get install -y timescaledb-postgresql-${PG_SERVER_VERSION}; \ - elif [ $(echo "$PG_SERVER_VERSION < 14" | /usr/bin/bc) = "1" ]; then \ + && apt-get install --no-install-recommends -y \ + timescaledb-postgresql-${PG_SERVER_VERSION}; \ + elif [ $(echo "$PG_SERVER_VERSION < 15" | /usr/bin/bc) = "1" ]; then \ echo "deb https://packagecloud.io/timescale/timescaledb/debian/ $(lsb_release -c -s) main" > /etc/apt/sources.list.d/timescaledb.list \ && wget --quiet -O - https://packagecloud.io/timescale/timescaledb/gpgkey | sudo apt-key add - \ && apt-get update \ - && apt install -y timescaledb-2-postgresql-${PG_SERVER_VERSION}; \ + && apt-get install --no-install-recommends -y \ + timescaledb-2-postgresql-${PG_SERVER_VERSION}; \ + fi \ + # citus extension; the latest versions only support Postgres 13+ + && if [ "${PG_SERVER_VERSION}" = "9.6" ]; then CITUS_VERSION="8.0"; \ + elif [ "${PG_SERVER_VERSION}" = "10" ]; then CITUS_VERSION="8.3"; \ + elif [ "${PG_SERVER_VERSION}" = "11" ]; then CITUS_VERSION="10.0"; \ + elif [ "${PG_SERVER_VERSION}" = "12" ]; then CITUS_VERSION="10.2"; \ + elif [ $(echo "$PG_SERVER_VERSION > 12" | /usr/bin/bc) = "1" ]; then CITUS_VERSION="11.0"; \ fi \ - # citus extension; only versions Postgres 11+ are supported - && if [ "${PG_SERVER_VERSION}" = "11" ]; then \ - curl -s https://install.citusdata.com/community/deb.sh | bash \ - && apt-get install -y postgresql-${PG_SERVER_VERSION}-citus-9.4 \ - postgresql-${PG_SERVER_VERSION}-hll=2.14.citus-1 \ - postgresql-${PG_SERVER_VERSION}-topn=2.3.0; \ - fi \ - && if [ $(echo "$PG_SERVER_VERSION > 11" | /usr/bin/bc) = "1" ]; then \ - curl -s https://install.citusdata.com/community/deb.sh | bash \ - && apt-get install -y postgresql-${PG_SERVER_VERSION}-citus-10.2 \ - postgresql-${PG_SERVER_VERSION}-hll=2.16.citus-1 \ - postgresql-${PG_SERVER_VERSION}-topn=2.4.0; \ - fi \ - # pg_timetable extension - && wget https://github.com/cybertec-postgresql/pg_timetable/releases/download/v2.3.0/pg_timetable_2.3.0_Linux_x86_64.deb \ - && dpkg -i pg_timetable_2.3.0_Linux_x86_64.deb \ - && rm -rf pg_timetable_2.3.0_Linux_x86_64.deb \ - # pg_show_plans extension - && git clone https://github.com/cybertec-postgresql/pg_show_plans.git \ - && cd pg_show_plans \ - && export USE_PGXS=1 && make && make install && cd .. && rm -rf pg_show_plans \ - # pg_cron extension - && apt-get install -y postgresql-${PG_SERVER_VERSION}-cron \ - # postgresql_anonymizer extension - && pgxn install ddlx && pgxn install postgresql_anonymizer \ - # pg_stat_kcache extension - && apt-get install postgresql-${PG_SERVER_VERSION}-pg-stat-kcache \ - # pg_wait_sampling extension - && apt-get install postgresql-${PG_SERVER_VERSION}-pg-wait-sampling \ - # add pg_qualstats extension - && apt-get install postgresql-${PG_SERVER_VERSION}-pg-qualstats \ - && if [ $(echo "$PG_SERVER_VERSION < 12" | /usr/bin/bc) = "1" ]; then \ - # bg_mon extension - apt-get install -yq --no-install-suggests --no-install-recommends brotli \ - && git clone https://github.com/CyberDem0n/bg_mon.git && cd bg_mon \ - && USE_PGXS=1 make && USE_PGXS=1 make install && cd .. ; \ - fi \ - # pgextwlist extension - && apt-get install postgresql-${PG_SERVER_VERSION}-pgextwlist \ - # set_user extension - && git clone https://github.com/pgaudit/set_user.git \ - && cd set_user && git checkout REL3_0_0 && make USE_PGXS=1 && make USE_PGXS=1 install \ - # errorlogs extension - && if [ $(echo "$PG_SERVER_VERSION > 9.6" | /usr/bin/bc) = "1" ]; then \ - cd /tmp && wget https://github.com/munakoiso/logerrors/archive/v2.0.tar.gz \ - && tar -xf v2.0.tar.gz && rm v2.0.tar.gz && cd logerrors-2.0 \ - && USE_PGXS=1 make && USE_PGXS=1 make install; \ - fi \ - # pgBackRest - && apt-get install --no-install-recommends -y pgbackrest=${PGBR_VERSION}* zstd openssh-client \ - && mkdir -p -m 700 /var/lib/postgresql/.ssh && chown postgres:postgres /var/lib/postgresql/.ssh \ - # remove all auxilary packages to reduce final image size - && cd / && rm -rf /tmp/* && apt-get purge -y --auto-remove gcc \ - make wget unzip curl libc6-dev apt-transport-https git \ - postgresql-server-dev-${PG_SERVER_VERSION} pgxnclient build-essential \ - libssl-dev krb5-multidev comerr-dev krb5-multidev libkrb5-dev apt-utils lsb-release \ - libgssrpc4 \ - && apt-get clean -y autoclean \ - && rm -rf /var/lib/apt/lists/* \ - # remove standard pgdata - && rm -rf /var/lib/postgresql/${PG_SERVER_VERSION}/ + && curl -s https://install.citusdata.com/community/deb.sh | bash \ + && apt-get install --no-install-recommends -y \ + postgresql-"${PG_SERVER_VERSION}"-citus-"${CITUS_VERSION}" \ + # hll extension + && apt-get install --no-install-recommends -y \ + postgresql-"${PG_SERVER_VERSION}"-hll \ + # topn extension + && apt-get install --no-install-recommends -y \ + postgresql-"${PG_SERVER_VERSION}"-topn \ + # pg_timetable extension + && wget https://github.com/cybertec-postgresql/pg_timetable/releases/download/v${PG_TIMETABLE_VERSION}/pg_timetable_${PG_TIMETABLE_VERSION}_Linux_x86_64.deb \ + && dpkg -i pg_timetable_${PG_TIMETABLE_VERSION}_Linux_x86_64.deb \ + && rm -rf pg_timetable_${PG_TIMETABLE_VERSION}_Linux_x86_64.deb \ + # pg_show_plans extension + && git clone https://github.com/cybertec-postgresql/pg_show_plans.git \ + && cd pg_show_plans \ + && export USE_PGXS=1 && make && make install && cd .. && rm -rf pg_show_plans \ + # pg_cron extension + && apt-get install --no-install-recommends -y \ + postgresql-${PG_SERVER_VERSION}-cron \ + # postgresql_anonymizer extension + && pgxn install ddlx && pgxn install postgresql_anonymizer \ + # pg_stat_kcache extension + && apt-get install --no-install-recommends -y \ + postgresql-${PG_SERVER_VERSION}-pg-stat-kcache \ + # pg_wait_sampling extension + && apt-get install --no-install-recommends -y \ + postgresql-${PG_SERVER_VERSION}-pg-wait-sampling \ + # pg_qualstats extension + && apt-get install --no-install-recommends -y \ + postgresql-${PG_SERVER_VERSION}-pg-qualstats \ + # bg_mon extension + && apt-get install -y libevent-dev libbrotli-dev \ + && git clone https://github.com/CyberDem0n/bg_mon.git && cd bg_mon \ + && USE_PGXS=1 make && USE_PGXS=1 make install && cd .. \ + # pgextwlist extension + && apt-get install --no-install-recommends -y \ + postgresql-${PG_SERVER_VERSION}-pgextwlist \ + # set_user extension + && git clone https://github.com/pgaudit/set_user.git \ + && cd set_user && git checkout REL3_0_0 && make USE_PGXS=1 && make USE_PGXS=1 install \ + # logerrors extension + && if [ $(echo "$PG_SERVER_VERSION > 9.6" | /usr/bin/bc) = "1" ]; then \ + cd /tmp && wget https://github.com/munakoiso/logerrors/archive/v2.0.tar.gz \ + && tar -xf v2.0.tar.gz && rm v2.0.tar.gz && cd logerrors-2.0 \ + && USE_PGXS=1 make && USE_PGXS=1 make install; \ + fi \ + # pgBackRest + && apt-get install --no-install-recommends -y \ + pgbackrest=${PGBR_VERSION}* zstd openssh-client \ + && mkdir -p -m 700 /var/lib/postgresql/.ssh \ + && chown postgres:postgres /var/lib/postgresql/.ssh \ + # remove all auxilary packages to reduce final image size + && cd / && rm -rf /tmp/* && apt-get purge -y --auto-remove \ + gcc make wget unzip curl libc6-dev apt-transport-https git \ + postgresql-server-dev-${PG_SERVER_VERSION} pgxnclient build-essential \ + libssl-dev krb5-multidev comerr-dev krb5-multidev libkrb5-dev apt-utils lsb-release \ + libgssrpc4 libevent-dev libbrotli-dev \ + && apt-get clean -y autoclean \ + && rm -rf /var/lib/apt/lists/* \ + # remove standard pgdata + && rm -rf /var/lib/postgresql/${PG_SERVER_VERSION}/ EXPOSE 5432