psql is a terminal-based front-end to PostgreSQL. It enables you to type in queries interactively, issue them to PostgreSQL, and see the query results.

Basic Commands

  • Create DB: CREATE DATABASE [database_name];
  • Delete DB: DROP DATABASE [database_name];
  • List all relations (tables): \d
  • List information about a table: \d table_name