# HG changeset patch # User Oleksandr Gavenko # Date 1546383545 -7200 # Node ID 24ffd84a171c13ef84c99416a0c4b9dd109613f0 # Parent 1b3ff9b88a1263c96c0ab4283e2d07a02b418c33 MVCC and transaction id. diff -r 1b3ff9b88a12 -r 24ffd84a171c 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 =================