From 2248e97ae02c8ee42b4ce186f3d0131a08cd59a1 Mon Sep 17 00:00:00 2001 From: aurorapar Date: Thu, 28 Mar 2024 02:47:30 -0500 Subject: [PATCH] Updated PostgreSQL Storage (markdown) --- PostgreSQL-Storage.md | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/PostgreSQL-Storage.md b/PostgreSQL-Storage.md index 56580c2..8d62623 100644 --- a/PostgreSQL-Storage.md +++ b/PostgreSQL-Storage.md @@ -16,19 +16,44 @@ You will notice statements like "CREATE DATABASE" after entering a command. This postgres=# CREATE DATABASE ; CREATE DATABASE +
+Postgres example (Click to expand) +
C:\Program Files\PostgreSQL\15\bin>psql -U postgres
+Password for user postgres:
+postgres=# CREATE DATABASE dynmap;
+CREATE DATABASE
+
+ ### Add new users **note:** If the Postgres server is on the same server as the minecraft server. should just be localhost -
postgres=# CREATE USER  WITH PASSWORD '';
+
postgres=# CREATE USER <DYNMAP_USER> WITH PASSWORD '';
+CREATE ROLE
+postgres=# ALTER DATABASE <DYNMAP_DATABASE> OWNER TO <DYNMAP_USER>;
+ALTER DATABASE
+ +
+Postgres example (Click to expand) +
postgres=# CREATE USER dynamp WITH PASSWORD 'CHANGE_ME_QUICK';
 CREATE ROLE
 postgres=# ALTER DATABASE dynmap OWNER TO dynmap;
 ALTER DATABASE
+
If you made a mistake and need to delete the user, this is how.
postgres=# DROP USER ;
+
+Postgres example (Click to expand) +
postgres=# DROP USER dynmap;
+ +A note: You can do this for databases, schemas (dynmap doesn't use any I believe), and users. If you play around with this, you may permanently lose data. +
postgres=# DROP DATABASE dynmap;
+postgres=# DROP SCHEMA maps;

+
+ After you create a new user, try logging into the user. (after you logout from the postgres user via "exit")
postgres -u