changeset 2298:34ffcffdc8df

List users. Switch database.
author Oleksandr Gavenko <gavenkoa@gmail.com>
date Thu, 13 Dec 2018 10:29:15 +0200
parents 4378d604c921
children fac6b2db427b
files postgres.rst
diffstat 1 files changed, 17 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/postgres.rst	Thu Dec 13 09:55:01 2018 +0200
+++ b/postgres.rst	Thu Dec 13 10:29:15 2018 +0200
@@ -1,13 +1,13 @@
 .. -*- coding: utf-8; -*-
 
 ==========
- Postgre.
+ Postgres
 ==========
 .. contents::
    :local:
 
-Installing on Debian.
-=====================
+Installing on Debian
+====================
 
 Install and create new user and database::
 
@@ -35,8 +35,8 @@
 https://wiki.debian.org/PostgreSql
   Debian wiki instructions.
 
-List databases, schemas and tables.
-===================================
+List databases, schemas and tables
+==================================
 
 Default database is ``postgres``.
 
@@ -64,14 +64,19 @@
   => SELECT table_schema,table_name FROM information_schema.tables ORDER BY table_schema,table_name;
   => \dt
 
+List users::
+
+  \du
+
 Set default schema.
 ===================
 ::
 
   set search_path to NAME;
+  set schema 'NAME';
 
-Database, table, index size.
-============================
+Database, table, index size
+===========================
 
 Database size::
 
@@ -122,3 +127,8 @@
   \o output_file
   SELECT * FROM pg_class;
 
+Switch database::
+
+  \connect DBNAME
+  \c DBNAME
+