Skip to content

PostgreSQL

Installation

Run as a Docker container

docker run --name psql -v "$PWD/psql":/var/lib/postgresql/data -e POSTGRES_PASSWORD=123456 -p 5432:5432 -d postgres:12.13-alpine

Commands

Sign in to the PSQL

PGPASSWORD=password psql -U postgres -h 127.0.0.1 -p 5432 -d dbname

List database

\l

List database name

\c

List table

\d

Quit the database

\q
Back to top