Skip to content

Instantly share code, notes, and snippets.

@torsday
Created August 22, 2013 23:45
Show Gist options
  • Select an option

  • Save torsday/6314081 to your computer and use it in GitHub Desktop.

Select an option

Save torsday/6314081 to your computer and use it in GitHub Desktop.
PostgreSQL #db #notes

PostgreSQL

Basics

List Databases

$ psql -l

Open up database

$ psql <database-name>

List Tables

> \d

Show Table Structure

> \d <table-name>

Basic statements

> select * from <table-name>

Quit

\q

Help

> help
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment