Lingxian Kong 72524f9d85 Support PostgreSQL 12
Change-Id: Ic1d4982a479c2154d7ddcc807d863e2a37fea506
2019-12-18 22:13:32 +00:00

26 lines
752 B
Bash
Executable File

#!/bin/sh
set -e
set -o xtrace
export DEBIAN_FRONTEND=noninteractive
cat > "/etc/sysctl.d/10-postgresql-performance.conf" << _EOF_
# See 'http://www.postgresql.org/docs/9.6/static/kernel-resources.html'
# for best practices.
# It is recommended to disable memory overcommit,
# but the Python interpreter may require it on smaller flavors.
# We therefore stick with the heuristic overcommit setting.
vm.overcommit_memory=0
_EOF_
apt-get --allow-unauthenticated -y install libpq-dev postgresql-12 postgresql-server-dev-12 postgresql-client-12
pgsql_conf=/etc/postgresql/12/main/postgresql.conf
sed -i "/listen_addresses/c listen_addresses = '*'" ${pgsql_conf}
systemctl restart postgresql
# Install the native Python client.
pip3 install psycopg2