postgre.rst
changeset 1701 6163ba5907d4
parent 1700 f987c277f760
child 1702 d2b977ccbf4f
equal deleted inserted replaced
1700:f987c277f760 1701:6163ba5907d4
    25 ..
    25 ..
    26 
    26 
    27   https://wiki.debian.org/PostgreSql
    27   https://wiki.debian.org/PostgreSql
    28     Debian wiki instructions.
    28     Debian wiki instructions.
    29 
    29 
    30 List all schemas and tables.
    30 List databases, schemas and tables.
    31 ============================
    31 ===================================
       
    32 
       
    33 Default database is ``postgres``.
       
    34 
       
    35 To list databases::
       
    36 
       
    37   => \l
       
    38 
       
    39 To switch databases::
       
    40 
       
    41   => \connect NAME
    32 
    42 
    33 Schemas::
    43 Schemas::
    34 
    44 
    35   => select schema_name from information_schema.schemata;
    45   => select schema_name from information_schema.schemata;
    36   => select nspname from pg_catalog.pg_namespace;
    46   => select nspname from pg_catalog.pg_namespace;
    37   => \dn *
    47   => \dn *
       
    48 
       
    49 To list all tables in the current database::
       
    50 
       
    51   => \dt
    38 
    52 
    39 Using psql client.
    53 Using psql client.
    40 ==================
    54 ==================
    41 
    55 
    42 Using password file ``~/.pgpass``::
    56 Using password file ``~/.pgpass``::