JournalSQLSetup and posting1 min

Most Common Commands You Will Need in PostgreSQL Shell

You can use SQL shell commands for PostgreSQL to display details about your database, its tables, and column properties.

  • psql
  • \dt
  • \d
  • \l

You Can Use SQL Shell Commands for PostgreSQL

To Display Details About Your Database, Its Tables, and Column Properties

To list the databases stored on your server

\l

To list tables across all schemas/databases

\dt *.*

To list tables in a specific schema/database

\dt database_name

To list columns of a specific table

\d database_name.table_name

Or you can connect to the database

\c database_name

Then list the columns like this

\d table_name

To Learn More Commands

Reference: (You will not need the remaining commands while practicing the track content)