how to instal psql linux
To install PostgreSQL (psql) on Linux, follow these steps:
- Update the package list:
sudo apt update
- Install PostgreSQL:
sudo apt install postgresql
- PostgreSQL service should start automatically after the installation. You can verify its status with:
sudo systemctl status postgresql
- By default, PostgreSQL creates a user called "postgres" with administrative privileges. To switch to the "postgres" user, run:
sudo su - postgres
- To access the psql command-line interface, type:
psql
That's it! You have successfully installed psql on Linux.