Check extensions.
authorOleksandr Gavenko <gavenkoa@gmail.com>
Thu, 03 Jan 2019 00:32:48 +0200
changeset 2328 71c08bde5a3c
parent 2327 24ffd84a171c
child 2329 738316fb865f
Check extensions.
postgres.rst
--- a/postgres.rst	Wed Jan 02 00:59:05 2019 +0200
+++ b/postgres.rst	Thu Jan 03 00:32:48 2019 +0200
@@ -61,6 +61,12 @@
 
    SELECT name, setting FROM pg_settings;
 
+Check extensions
+================
+::
+
+   SELECT * FROM pg_available_extensions;
+
 List databases, schemas and tables
 ==================================
 
@@ -81,14 +87,14 @@
 
 Schemas::
 
-  => select schema_name from information_schema.schemata;
-  => select nspname from pg_catalog.pg_namespace;
-  => \dn *
+  \dn *
+  select schema_name from information_schema.schemata;
+  select nspname from pg_catalog.pg_namespace;
 
 To list all tables in the current database::
 
-  => SELECT table_schema,table_name FROM information_schema.tables ORDER BY table_schema,table_name;
-  => \dt
+  \dt
+  SELECT table_schema, table_name FROM information_schema.tables ORDER BY table_schema, table_name;
 
 or in all schemas::
 
@@ -110,6 +116,10 @@
 List indexes::
 
   \di
+  select * from pg_indexes;
+  select * from pg_indexes where schemaname = '...';
+  select * from pg_indexes where schemaname = '...' and tablename = '...';
+  select * from pg_indexes where schemaname = '...' and indexname = '...';
 
 List functions::
 
@@ -175,6 +185,13 @@
 
   SELECT xmin, xmax, * FROM foo WHERE id < 5 ORDER BY id;
 
+Vacuum
+======
+
+Stats on vacuum oprtations per table::
+
+  select * from pg_stat_user_tables;
+
 Using psql client
 =================