Browse Source

Upgrade PostgreSQL to version 11 (#4642)

* Activate PostgreSQL APT repository and make teh setting of WAL level=minimal explicit

* Fix key import

* Change PostgreSQL version in the variable

* Set max_wal_senders explicitly to 0

* Change hardcoded path locations from 9.5 to 11
Radoslav Petrov 6 years ago
parent
commit
c1c5d1ce03

+ 2 - 0
toolset/databases/postgres/pgdg.list

@@ -0,0 +1,2 @@
+deb http://apt.postgresql.org/pub/repos/apt/ xenial-pgdg main
+deb-src http://apt.postgresql.org/pub/repos/apt/ xenial-pgdg main

+ 6 - 1
toolset/databases/postgres/postgres.dockerfile

@@ -13,12 +13,17 @@ ADD pg_hba.conf pg_hba.conf
 ADD 60-postgresql-shm.conf 60-postgresql-shm.conf
 ADD create-postgres-database.sql create-postgres-database.sql
 ADD create-postgres.sql create-postgres.sql
+ADD pgdg.list pgdg.list
+
+# prepare PostgreSQL APT repository
+RUN cp pgdg.list /etc/apt/sources.list.d/
+RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys ACCC4CF8
 
 # install postgresql on database machine
 RUN apt-get -y update > /dev/null
 RUN apt-get -y install -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" postgresql > /dev/null
 
-ENV PG_VERSION 9.5
+ENV PG_VERSION 11
 
 # Make sure all the configuration files in main belong to postgres
 RUN mv postgresql.conf /etc/postgresql/${PG_VERSION}/main/postgresql.conf

+ 5 - 5
toolset/databases/postgres/postgresql.conf

@@ -40,13 +40,13 @@
 
 data_directory = '/ssd/postgresql'		# use data in another directory
 					# (change requires restart)
-hba_file = '/etc/postgresql/9.5/main/pg_hba.conf'	# host-based authentication file
+hba_file = '/etc/postgresql/11/main/pg_hba.conf'	# host-based authentication file
 					# (change requires restart)
-ident_file = '/etc/postgresql/9.5/main/pg_ident.conf'	# ident configuration file
+ident_file = '/etc/postgresql/11/main/pg_ident.conf'	# ident configuration file
 					# (change requires restart)
 
 # If external_pid_file is not explicitly set, no extra PID file is written.
-external_pid_file = '/var/run/postgresql/9.5-main.pid'		# write an extra PID file
+external_pid_file = '/var/run/postgresql/11-main.pid'		# write an extra PID file
 					# (change requires restart)
 
 
@@ -163,7 +163,7 @@ random_page_cost = 2
 
 # - Settings -
 
-#wal_level = minimal			# minimal, archive, or hot_standby
+wal_level = minimal			# minimal, archive, or hot_standby
 					# (change requires restart)
 #fsync = on				# turns forced synchronization on or off
 
@@ -211,7 +211,7 @@ synchronous_commit = off
 
 # These settings are ignored on a standby server
 
-#max_wal_senders = 0		# max number of walsender processes
+max_wal_senders = 0		# max number of walsender processes
 				# (change requires restart)
 #wal_sender_delay = 1s		# walsender cycle time, 1-10000 milliseconds
 #wal_keep_segments = 0		# in logfile segments, 16MB each; 0 disables