psql vs pgWhen you work with PostgreSQL, there are two common ways to connect and interact with your database:
psql β CLI (manual interaction, debugging, admin tasks)pg β Node.js library (programmatic interaction inside your backend)psql β Command-line Interface for PostgreSQLpsql is a terminal-based interactive shell for PostgreSQL.
It comes preinstalled when you install Postgres locally or via Docker.
You can use it to:
psql -h <host> -p <port> -U <username> -d <database>
psql -h localhost -p 5432 -U postgres -d mydb
or using password inline: