6.4. The User Interface

You have seen how to create a database cluster and how to create and remove databases, and it is time to learn about PostgreSQL's user interface. The standard front end that is included in the core distribution of PostgreSQL is called psql. psql is an interactive tool for communicating with a PostgreSQL database. A database accessed by psql need not be situated on the local machine because psql can even communicate with remote machines.

bash-2.04$ createdb phpbook
						-e
CREATE DATABASE "phpbook"
CREATE DATABASE

After creating the database, you can start psql to work with the database interactively. Therefore you simply have to pass the name of the database to psql:

bash-2.04$ psql phpbook Welcome to psql, the PostgreSQL ...

Get PHP and PostgreSQL: Advanced Web Programming now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.