MVCC and transaction id.
authorOleksandr Gavenko <gavenkoa@gmail.com>
Wed, 02 Jan 2019 00:59:05 +0200
changeset 2327 24ffd84a171c
parent 2326 1b3ff9b88a12
child 2328 71c08bde5a3c
MVCC and transaction id.
postgres.rst
--- a/postgres.rst	Wed Jan 02 00:55:00 2019 +0200
+++ b/postgres.rst	Wed Jan 02 00:59:05 2019 +0200
@@ -119,7 +119,6 @@
 
   \dy
 
-
 List misc info::
 
   select current_database();
@@ -167,6 +166,15 @@
 
   SELECT relname, relpages FROM pg_class ORDER BY relpages DESC;
 
+MVCC and transaction id
+=======================
+
+As being MVCC Postgres doesn't delete or update existing rows. Row visibility is controled by
+transaction id (monotonous incremented number): ``xmin`` - first transaction that can see row,
+``xmax`` - last transaction that can see row:::
+
+  SELECT xmin, xmax, * FROM foo WHERE id < 5 ORDER BY id;
+
 Using psql client
 =================