From ac7c572733282e49801b16531d841682e3ab1b5a Mon Sep 17 00:00:00 2001 From: Silvino Silva Date: Sun, 19 Jan 2020 00:59:14 +0000 Subject: documentation date and domain update --- tools/postgresql.html | 49 ++++++++++++++++++++++++++++++++----------------- 1 file changed, 32 insertions(+), 17 deletions(-) (limited to 'tools/postgresql.html') diff --git a/tools/postgresql.html b/tools/postgresql.html index 285e7c3..1fb48c7 100644 --- a/tools/postgresql.html +++ b/tools/postgresql.html @@ -210,7 +210,7 @@
         $ sudo -u postgres createuser --pwprompt --encrypted \
-        --no-createrole --no-createdb flyspray
+        --no-createrole --no-createdb user_example
         Enter password for new user:
         Enter it again:
         
@@ -221,7 +221,7 @@
         $ sudo -u postgres createdb --template=template0 --encoding=UTF8 \
-        --owner=flyspray db_flyspray
+        --owner=user_example db_example
         

5. Drop Database

@@ -229,7 +229,7 @@

Deleting database with dropdb command;

-        sudo -u postgres dropdb db_flyspray
+        sudo -u postgres dropdb db_example
         

6. Drop User

@@ -237,7 +237,7 @@

Deleting user with dropuser command;

-        sudo -u postgres dropuser flyspray
+        sudo -u postgres dropuser user_example
         

7. Psql

@@ -263,32 +263,47 @@ postgres=# \l +

Connect to a datase;

+ +
+        postgres=# \c db_example
+        
+ +

List tables;

+ +
+        postgres=# \dt
+        
+

7.2. Create Database

-        postgres=# create database db_flyspray_ext owner flyspray encoding 'UTF-8' template template0;
+        postgres=# create database db_example_ext owner user_example encoding 'UTF-8' template template0;
         
-

7.3. Drop Tables

+

7.3. Drop All Tables

This example assumes that all tables, - are in public schema. First connect to database and - list tables;

+ are in public schema. First revoke previously granted privileges from one or more roles;

-        postgres=# revoke SELECT on db_flyspray from flyspray;
+        postgres=# revoke ALL PRIVILEGES on db_example from user_example;
         
+

Drop all tables on public schema and recreate public schema;

+
-        postgres=# \c db_flyspray
-        postgres=# \dt
+        postgres=# \c db_example
+        db_example=# drop schema public cascade;
+        db_example=# create schema public;
         
-

Drop all tables on public schema and recreate public schema;

+

7.4. Change user password

+ +

Update password of a user;

-        db_flyspray=# drop schema public cascade;
-        db_flyspray=# create schema public;
+        postgres=# ALTER USER user_example WITH ENCRYPTED PASSWORD 'password';
         

8. Backup and restore

@@ -307,9 +322,9 @@ Tools Index

- This is part of the Hive System Documentation. - Copyright (C) 2019 - Hive Team. + This is part of the Tribu System Documentation. + Copyright (C) 2020 + Tribu Team. See the file Gnu Free Documentation License for copying conditions.

-- cgit 1.4.1-2-gfad0