- Learning PostgreSQL 10(Second Edition)
- Salahaldin Juba Andrey Volkov
- 296字
- 2021-07-02 22:42:09
Client installation
If you have a PostgreSQL server already installed and you need to interact with it, then you need to install the posttgresql-client software package. In order to do so, open a terminal and execute the following command:
sudo apt-get install PostgreSQL-client-10
With the installation of postgrsql-client-10, several tools are installed including the PostgreSQL interactive terminal (psql), which is a very powerful interactive frontend tool for PostgreSQL. To see the full list of installed programs, one can browse the installation directory. Note that the installation path might vary depending on the installed PostgreSQL version and also depending on the operating system:
ls /usr/lib/PostgreSQL/10/bin/
clusterdb createdb createuser dropdb dropuser pg_basebackup pg_dump pg_dumpall pg_isready pg_receiveWAL pg_recvlogical pg_restore psql reindexdb vacuumdb
In order to connect to an existing PostgreSQL server using psql, one needs to specify the connection string, which might include the host, the database, the port, and the username.
Another powerful frontend graphical user interface (GUI) tool is pgadmin4, which is used for PostgreSQL administration and development. pgAdmin is favored by beginners, while psql can be used for shell scripting.
pgadmin4 has many features, such as cross-platform, web-based, server and desktop modes, and so on. In order to install pgAdmin in desktop mode, one should run the following command:
# get virtual environment and pip
sudo apt-get install pip
sudo pip install --upgrade pip
sudo pip install virtualenvwrapper
# create a virtual environment and activate it
virtualenv pgadmin && cd pgadmin && source bin/activate
# get recent version f pgadmin and install it.
wget https://ftp.PostgreSQL.org/pub/pgadmin/pgadmin4/v2.0/pip/pgadmin4-2.0-py2.py3-none-any.whl
pip install pgadmin4-2.0-py2.py3-none-any.whl
# create a configuration based on config.py and run it
cp ./lib/python2.7/site-packages/pgadmin4/config.py ./lib/python2.7/site-packages/pgadmin4/config-local.py
python ./lib/python2.7/site-packages/pgadmin4/pgAdmin4.py
Another GUI tool to interact with PostgreSQL is DBeaver https://dbeaver.jkiss.org/. This tool provides a universal SQL client for many databases including PostgreSQL.
- Mastering Mesos
- 電腦上網(wǎng)直通車
- 模型制作
- PHP開發(fā)手冊
- JSP從入門到精通
- Implementing AWS:Design,Build,and Manage your Infrastructure
- 大數(shù)據(jù)驅(qū)動的機(jī)械裝備智能運(yùn)維理論及應(yīng)用
- 網(wǎng)絡(luò)服務(wù)器搭建與管理
- 智能制造系統(tǒng)及關(guān)鍵使能技術(shù)
- 與人共融機(jī)器人的關(guān)節(jié)力矩測量技術(shù)
- Redash v5 Quick Start Guide
- 巧學(xué)活用Linux
- 智能控制技術(shù)及其應(yīng)用
- Spark Streaming實(shí)時流式大數(shù)據(jù)處理實(shí)戰(zhàn)
- Mastercam X5應(yīng)用技能基本功特訓(xùn)