Install PostgreSQL and Choose a Client

PostgreSQL can run locally, in a container, on a virtual machine, or as a managed cloud database. Common clients include psql, the official interactive terminal, and GUI clients such as pgAdmin. The server stores and manages the database; the client sends SQL statements and displays results.

Keep local development, testing, and production environments distinct. Record the server version and configuration used by your application. When learning, a local installation or disposable container is convenient, but do not expose a database port publicly without appropriate network restrictions and authentication.

Check the client version
psql --version
pg_isready
💡 psql --version reports the installed client version. pg_isready checks whether a PostgreSQL server is accepting connections at the selected host and port; a successful readiness check does not prove that a particular user has authorization to access a database.
Key Takeaways
  • The server and client are separate components.
  • psql is PostgreSQL's interactive terminal client.
  • A readiness check is not the same as an authenticated query.
Knowledge Check

What does `psql` primarily provide?