ubuntu 16.04 + apt/make + postgresql 11 postgresql 10 postgresql9.6


os: ubuntu 16.04 db: postgresql 11

os設定


参照<>
リファレンスhttps://www.postgresql.org/download/linux/ubuntu/pgdg aptソースの構成

apt install postgresql 11

# apt install libpq5 libpq-dev pgdg-keyring ssl-cert \
postgresql-plperl-11 postgresql-pltcl-11 postgresql-plpython-11 postgresql-plpython3-11 \
postgresql-11 postgresql-common  postgresql-server-dev-11 postgresql-contrib \
postgresql-client-11 postgresql-client-common postgresql-doc-11


アンインストール方法
# apt-get remove --purge libpq5 libpq-dev pgdg-keyring ssl-cert \
postgresql-plperl-11 postgresql-pltcl-11 postgresql-plpython-11 postgresql-plpython3-11 \
postgresql-11 postgresql-common  postgresql-server-dev-11 postgresql-contrib \
postgresql-client-11 postgresql-client-common postgresql-doc-11


apt install postgresql 10

# apt install libpq5 libpq-dev pgdg-keyring ssl-cert \
postgresql-plperl-10 postgresql-pltcl-10 postgresql-plpython-10 postgresql-plpython3-10 \
postgresql-10 postgresql-common postgresql-server-dev-10 \
postgresql-client-10 postgresql-client-common  postgresql-doc-10


アンインストール方法
# apt-get remove --purge libpq5 libpq-dev pgdg-keyring ssl-cert \
postgresql-plperl-10 postgresql-pltcl-10 postgresql-plpython-10 postgresql-plpython3-10 \
postgresql-10 postgresql-common postgresql-server-dev-10 \
postgresql-client-10 postgresql-client-common  postgresql-doc-10


apt install postgresql 9.6

# apt install libpq5 libpq-dev pgdg-keyring ssl-cert \
postgresql-plperl-9.6 postgresql-pltcl-9.6 postgresql-plpython-9.6 postgresql-plpython3-9.6 \
postgresql-9.6 postgresql-common postgresql-server-dev-9.6 \
postgresql-client-9.6 postgresql-client-common  postgresql-doc-9.6


アンインストール方法
# apt-get remove --purge libpq5 libpq-dev pgdg-keyring ssl-cert \
postgresql-plperl-9.6 postgresql-pltcl-9.6 postgresql-plpython-9.6 postgresql-plpython3-9.6 \
postgresql-9.6 postgresql-common postgresql-server-dev-9.6 \
postgresql-client-9.6 postgresql-client-common  postgresql-doc-9.6

# systemctl status postgresql
# systemctl stop postgresql
# systemctl start postgresql


make&&make install方式

# su - postgres
$ cd /tmp
$ wget https://ftp.postgresql.org/pub/source/v11.2/postgresql-11.2.tar.gz
$ tar -zxvf ./postgresql-11.2.tar.gz
$ cd ./postgresql-11.2
$ ./configure --prefix=/usr/pgsql-11 --with-perl --with-tcl --with-python --with-openssl --with-gssapi \
--with-pam --without-ldap --with-libxml --with-libxslt \
--enable-thread-safety --enable-dtrace --enable-profiling --enable-debug \
--with-libedit-preferred --with-uuid=ossp

$ make world
$ make install-world

$ pg_config

$ /usr/pgsql-11/bin/initdb -D /data/pgsql-11/data/ \
-U postgres \
-E UTF8 \
--locale=en_US.UTF-8  \
--debug \
--data-checksums

$ pg_ctl start -D /data/pgsql-11/data/ -o "-c config_file=/data/pgsql-11/data/postgresql.conf"

$ pg_ctl stop -m fast -D /data/pgsql-11/data/


リファレンスhttps://www.postgresql.org/download/linux/ubuntu/