postgres.rst
changeset 2327 24ffd84a171c
parent 2326 1b3ff9b88a12
child 2328 71c08bde5a3c
equal deleted inserted replaced
2326:1b3ff9b88a12 2327:24ffd84a171c
   117 
   117 
   118 List triggers::
   118 List triggers::
   119 
   119 
   120   \dy
   120   \dy
   121 
   121 
   122 
       
   123 List misc info::
   122 List misc info::
   124 
   123 
   125   select current_database();
   124   select current_database();
   126   select current_schema();
   125   select current_schema();
   127   select current_user;
   126   select current_user;
   165 
   164 
   166 Largest table in the PostgreSQL database::
   165 Largest table in the PostgreSQL database::
   167 
   166 
   168   SELECT relname, relpages FROM pg_class ORDER BY relpages DESC;
   167   SELECT relname, relpages FROM pg_class ORDER BY relpages DESC;
   169 
   168 
       
   169 MVCC and transaction id
       
   170 =======================
       
   171 
       
   172 As being MVCC Postgres doesn't delete or update existing rows. Row visibility is controled by
       
   173 transaction id (monotonous incremented number): ``xmin`` - first transaction that can see row,
       
   174 ``xmax`` - last transaction that can see row:::
       
   175 
       
   176   SELECT xmin, xmax, * FROM foo WHERE id < 5 ORDER BY id;
       
   177 
   170 Using psql client
   178 Using psql client
   171 =================
   179 =================
   172 
   180 
   173 Using password file ``~/.pgpass``::
   181 Using password file ``~/.pgpass``::
   174 
   182