From af9caca6271a1bd768b10418bd75816b4cf6b5c3 Mon Sep 17 00:00:00 2001 From: Marcin Chrzanowski Date: Wed, 21 Dec 2022 01:12:43 +0100 Subject: Add PostgreSQL stuff --- postgres.md | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 postgres.md diff --git a/postgres.md b/postgres.md new file mode 100644 index 0000000..28a0043 --- /dev/null +++ b/postgres.md @@ -0,0 +1,24 @@ +# The PostgreSQL DBMS + +Default user, db: `postgres` + +## User management + +Everything should be done as user `postgres`. + +New user: + + createuser --pwprompt mypguser + +Change password: + + # in `psql` + ALTER ROLE user WITH PASSWORD 'xxx'; + +## New database + + sudo su postgres + createdb -O mypguser mypgdatabase + + # delete db + dropdb mypgdatabase -- cgit v1.2.3