PostgreSQL - adriennelim/wikis GitHub Wiki

Terminal Commands

CheatSheet

psql
/c <db_name>           //--> connect to db
\dt                    //--> show all tables
\i path_to_sql_file    //--> load sql file into postgres

schema.sql file

DROP DATABASE IF EXISTS <db_name>;

CREATE DATABASE <db_name>;

\connect <db_name>

CREATE TABLE <table_name> (
    id SERIAL PRIMARY KEY,
    col_1 VARCHAR(100),
    col_2 VARCHAR(255)
);
⚠️ **GitHub.com Fallback** ⚠️