Skip to content

lifeparticle/PostgreSql-Snippets

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PostgreSql-Snippets

How to Run PostgreSQL Using Docker

How to Connect to a PostgreSQL Database With a Python Serverless Function

How to Connect to a Heroku Postgres Database With pgAdmin Using Docker

How to Run PostgreSQL and pgAdmin Using Docker

brew services start postgresql
createuser -s postgres
brew services restart postgresql

brew unlink postgresql@13
brew link postgresql@12

brew info postgresql
psql -U mahbubzaman -d postgres
ALTER ROLE postgres WITH SUPERUSER
brew services restart postgresql@14

psql postgres

# List of Roles 
\du

Role name  |                         Attributes                         | Member of 
-------------+------------------------------------------------------------+-----------
 mahbubzaman | Superuser | {}
 postgres    | Superuser | {}

# List of databases
\l

CREATE DATABASE DB_NAME;

# Select the db
\c DB_NAME

# Show tables
\dt


# Quit
\q