Menu

gitpiper

PostgreSQL Cheat Sheet in May 2023

Last Updated: 16 May 2023

README.md

Replace anything within <placeholder> accordingly

Console

$ psql #logs in to default database & default user
$ sudo -u <rolename:postgres> psql #logs in with a particular user

Commands

  • Show roles: \du
  • Show tables: \dt
  • Show databases: \l
  • Connect to a database: \c <database>
  • Show columns of a table: \d <table> or \d+ <table>
  • Quit: \q

Creating database

 $ createdb databasename

338+ more cheat sheets for you in May 2023

Subscribe to our Newsletter

Subscribe to get resources directly to your inbox. You won't receive any spam! ✌️

© 2023 GitPiper. All rights reserved

Rackpiper Technology Inc

Company

About UsBlogContact

Subscribe to our Newsletter

Subscribe to get resources directly to your inbox. You won't receive any spam! ✌️