Last active
February 2, 2020 05:07
-
-
Save warrenlalata/82f722538e6e0c19146465cce96768c7 to your computer and use it in GitHub Desktop.
Postgres Cheatsheet
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Open psql terminal | |
psql -U postgres -h localhost | |
Create database | |
create database dbname; | |
List databases | |
\l | |
Create user to work with db create | |
create user username with password 'password'; | |
Drop database | |
drop database dbname; | |
Connect to database within psql terminal | |
\c dbname; | |
Connect to database | |
psql dbname; | |
Show tables | |
\dt | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment