I work in the terminal on the command line
with postgresql
installed and running in the background
and use psql
and related postgresql command pgdump
pg_restore
createdb
, …
Use a UI interface pgAdmin
.
wsl
or ??? with admin permissions.PATH
environment variable.https://www.postgresql.org/download/
https://www.enterprisedb.com/downloads/postgres-postgresql-downloads
I wrote a detailled step by step guide for windows users here:
for mac: https://www.postgresql.org/download/macosx/
for mac: https://eggerapps.at/postico/
make sure you know how to
postgres
brew services start postgresql@16
brew services stop postgresql@16
postgres
is running with
launchctl list | grep postgres
psql
in the terminal
psql -U postgres | your_local_username
\du
: you should see 1 or 2 users
postgres
\
Postgresql has a specific syntax to list databases, tables, users etc, all start with \
\l # list databases
\c <database_name># connect to a database
\du # list users
and
\d # list all tables, views, sequences
\dt # list tables
\d <table_name> # shows columns of a specific table
\df # list functions
\dn # list schemas
\dv # list views
and most important (a bit like exiting vim
):
\q # quit
https://commandprompt.com/education/postgresql-basic-psql-commands/
this seems like a good walkthrough for windows (screenshots are windows)
https://www.tpointtech.com/connect-to-a-postgresql-database-server
and this for both mac and windows
launchctl list | grep postgres
or brew services list
start | stop it with brew services start | stop postgresql@16 |
createdb
in the terminalconnect to a local database ( psql |
pgadmin ) |