postgre.rst
author Oleksandr Gavenko <gavenkoa@gmail.com>
Wed, 11 Mar 2015 22:09:00 +0200
changeset 1697 f41d35f4af39
parent 1684 88f1d11d2adf
child 1700 f987c277f760
permissions -rw-r--r--
Remove trailing spaces.

.. -*- coding: utf-8; -*-
.. include:: HEADER.rst

==========
 Postgre.
==========
.. contents::

Installing on Debian.
=====================

Install and create new user and database::

  $ sudo apt-get install postgresql postgresql-client
  $ sudo su - postgres
  postgres=# CREATE USER "mypguser" WITH PASSWORD 'mypguserpass';
  postgres=# CREATE DATABASE "mypgdatabase" OWNER "mypguser";
  postgres=# \q

Connect as user ``mypguser`` to new database::

  $ su - mypguser
  $ psql mypgdatabase

..

  https://wiki.debian.org/PostgreSql
    Debian wiki instructions.

List all schemas and tables.
============================

Schemas::

  => select schema_name from information_schema.schemata;
  => select nspname from pg_catalog.pg_namespace;
  => \dn *