changeset 2327:24ffd84a171c

MVCC and transaction id.
author Oleksandr Gavenko <gavenkoa@gmail.com>
date Wed, 02 Jan 2019 00:59:05 +0200
parents 1b3ff9b88a12
children 71c08bde5a3c
files postgres.rst
diffstat 1 files changed, 9 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- 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
 =================