Skip to content

Instantly share code, notes, and snippets.

View fqf2009's full-sized avatar

Frank Feng fqf2009

  • Victoria, BC, Canada
View GitHub Profile
@fqf2009
fqf2009 / postgresql-cheatsheet.md
Created January 4, 2022 06:41 — forked from davydany/postgresql-cheatsheet.md
PostgreSQL Cheat Sheet

PostgreSQL Cheat Sheet

My personal Cheatsheet for PostgreSQL

Quick Commands

Creating a DB and Setting its Ownership

To create a database, you need to first ensure that the database's role exists first. Role and User are synonymous in PostgreSQL. Once you create the ROLE, you can create the Database and set the OWNER as the ROLE.