PostgreSQL is an object-RDBMS (ORDBMS) developed by the PostgreSQL Global Development Group.
1
2
3
|
sudo yum -y install https://download.postgresql.org/pub/repos/yum/reporpms/EL-6-x86_64/pgdg-redhat-repo-latest.noarch.rpm
sudo yum -y install postgresql95-server postgresql95 libpqxx-devel postgresql-devel
|
1
|
sudo service postgresql-9.5 initdb
|
1
|
sudo service postgresql-9.5 start
|
1
|
sudo chkconfig postgresql-9.5 on
|
1
2
|
sudo mv /usr/bin/psql /usr/bin/psql-bk
sudo ln -sfn /usr/pgsql-9.5/bin/psql /usr/bin/psql
|
1
2
3
4
5
6
7
8
|
sudo -u postgres psql
postgres=#
# quit
postgres=# \q
# show all databases
postgres=# \l
|
1
|
/usr/pgsql-9.5/bin/pg_dump redash | gzip > backup_redash_20181218.gz
|
1
2
|
sudo -u postgres psql
postgres=# CREATE DATABASE redash2;
|
1
|
sudo -u postgres psql redash2 < backup_redash_20181218.sql
|
1
|
docker pull postgres:9.6.5
|
1
|
docker run --name postgres-5432 -e POSTGRES_PASSWORD=mysecretpassword -p 5432:5432 -d postgres:9.6.5
|