To install PSQL without the full Postgres installation on macOS, you can use the following methods:
Method 1: Install using Homebrew
You can install the PSQL command-line tool using Homebrew by running the following command:
This will install the libpq library, which includes the PSQL command-line tool.
Method 2: Install using Postgres .app
You can download and install Postgres. app, which includes the PSQL command-line tool. However, this method will also install the full Postgres database server.
To install only the PSQL command-line tool using Postgres. app, follow these steps:
1. Download and install Postgres. app from the official website.
2. Open the Postgres. app application.
3. Click on the “PSQL” button in the top menu bar.
4. Select “Install Command Line Tools” from the dropdown menu.
This will install the PSQL command-line tool without installing the full Postgres database server.
Method 3: Install using PQCLI
You can install pgcli, which is a command-line interface for Postgres that includes the PSQL command-line tool.
To install PQCLI, run the following command: bash – pip install pgcli
This will install the pgcli command-line tool, which includes the PSQL command-line tool.
Regardless of the method you choose, verify that the PSQL command-line tool is installed correctly.