Updates

Let's create a simple table with one row in it to get started.

The first two lines in the following code are duplicated from Chapter 5, Memory for Database Caching. If you've already created them there, you should DROP TABLE t before this session to clear them out:

$ psql -c "CREATE TABLE t (s SERIAL, i INTEGER);" 
$ psql -c "INSERT into t(i) values (0)" 
INSERT 0 1 
$ psql -c "SELECT *,xmin,xmax from t;" 
 s | i |  xmin  | xmax  
---+---+--------+------ 
 1 | 0 | 158208 |    0 
$ psql -c "SELECT txid_current(); 
 txid_current  
-------------- 
       158209

So there's the new row inserted, with the transaction ID xmin active for the statement that inserted it. There's no maximum yet because nothing has ever updated or deleted this row.

Now run psql, start ...

Get PostgreSQL 10 High Performance now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.