psql postgres
or psql postgres -U patrick
(as the user "patrick")
postgres=# CREATE DATABASE djangoblog;
postgres=> GRANT ALL PRIVILEGES ON DATABASE my_db TO patrick;
postgres=# ALTER USER postgres WITH PASSWORD 'new_password';
- \du: display users | or \du+: display users w details (adds an additional column called description)
- \list: lists all the databases in Postgres
- \connect: connect to a specific database
- \dt: list the tables in the currently connected database
- \q: quit
HAPPY LEARNING! 👍