This is a slightly more advanced topic looking at something called psql which is a command line tool which you will want to do if you are doing basic database administration tasks like importing shape files and importing csv files. If you are new to Postgresql I recommend you work through the other topics first.
To install psql
without the rest of the PostgreSQL package, you can use your operating system’s package manager. Here are the steps to install psql on some common operating systems:
- macOS
- Debian/Ubuntu
- Red Hat/CentOS
- Fedora
- Windows
Windows
For windows users use the package manager and select the appropriate option at install see LINK to interactive installer by EDB.
This is the usual way of installing PostgreSQL on Windows. But to install the client only, select Command Line Tools and uncheck other options when selecting components during installation.
Background
Sometimes you need a PostgreSQL client, not the PostgreSQL server. The PostgreSQL official installers and packages come with all the components needed to run a PostgreSQL server, but some of these components are often not needed.
psql
, which is included in the PostgreSQL package, is a command-line interface for interacting with PostgreSQL databases. psql
is an essential tool for you to connect to postgres, issue SQL queries, and manage database objects.