ubuntu16 install postgresql 9.6

https://www.postgresql.org/download/linux/ubuntu/

1.add source
echo 'deb http://apt.postgresql.org/pub/repos/apt/ xenial-pgdg main' > /etc/apt/sources.list.d/pgdg.list
2.update system
wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | \
sudo apt-key add -
sudo apt-get update

3.install
apt-get install postgresql-9.6


5.add path
su postgres && cd ~
#vi .bash_profile
PATH=$PATH:/usr/lib/postgresql/9.6/bin/
alias ll="ls -la"
export PATH
source .bash_profile

6.init db and start/stop service
initdb /var/lib/postgresql/test
pg_ctl -D /var/lib/postgresql/test -l logfile start
pg_ctl -D /var/lib/postgresql/test -l logfile stop

打赏

发表评论

电子邮件地址不会被公开。 必填项已用*标注