Read Committed isolation level

Create a table:

α=> CREATE TABLE t(n integer);
CREATE TABLE
α=> INSERT INTO t VALUES (42);
INSERT 0 1

Query the table from the first transaction:

α=> BEGIN;
BEGIN
α=> SELECT * FROM t;
 n  
----
 42
(1 row)

Delete the row in the second transaction and commit the change:

α=> DELETE FROM t;
DELETE 1

Query the table:

α=> SELECT * FROM t;
 n 
---
(0 rows)

The first transaction sees the committed changes.

α=> COMMIT;
COMMIT

Repeatable Read isolation level

Return the row back to the table:

α=> INSERT INTO t VALUES (42);
INSERT 0 1

Query the table from the first transaction:

α=> BEGIN ISOLATION LEVEL REPEATABLE READ;
BEGIN
α=> SELECT * FROM t;
 n  
----
 42
(1 row)

Delete the row in the second transaction and commit the change:

α=> DELETE FROM t;
DELETE 1

Query the table:

α=> SELECT * FROM t;
 n  
----
 42
(1 row)

On this level the first transaction doesn't see the committed changes.

α=> COMMIT;
COMMIT