Skip to content

Instantly share code, notes, and snippets.

View thachda0106's full-sized avatar

Nguyễn Ngọc Thạch thachda0106

View GitHub Profile
@thachda0106
thachda0106 / postgresql-cheatsheet.md
Created September 28, 2024 08:06 — 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.