Document txid functions.
authorBruce Momjian
Mon, 5 Nov 2007 14:51:08 +0000 (14:51 +0000)
committerBruce Momjian
Mon, 5 Nov 2007 14:51:08 +0000 (14:51 +0000)
Marko Kreen

doc/src/sgml/datatype.sgml
doc/src/sgml/func.sgml

index f7724f5e7045be5aac9291fbaa864959d238fcb5..e1e157ab379aafd776478cfd8558506bba45313d 100644 (file)
@@ -1,4 +1,4 @@
-
+
 
  
   Data Types
@@ -3437,6 +3437,77 @@ SELECT to_tsquery('Fat:ab & Cats');
 
   
 
+  
+   Transaction Snapshot Type
+
+   
+    txid_snapshot
+   
+
+   
+    The data type txid_snapshot stores info about transaction ID
+    visibility at a particular moment in time. The components are
+    described in .
+   
+
+   
+    Snapshot components
+    
+     
+      
+       Name
+       Query Function
+       Description
+      
+     
+
+     
+
+      
+       xmin
+       txid_snapshot_xmin()
+       
+         Earliest transaction ID that is still active.  All earlier
+         transactions will either be committed and visible, or rolled
+         back and dead.
+       
+      
+
+      
+       xmax
+       txid_snapshot_xmax()
+       
+        Next unassigned txid.  All txids later than this one are
+        unassigned, and thus invisible.
+       
+      
+
+      
+       xip_list
+       txid_snapshot_xip()
+       
+        Active txids at the time of snapshot.  All of them are between
+        xmin and xmax.  A txid that is xmin <= txid <
+        xmax and not in this list is visible.
+       
+      
+
+     
+    
+   
+
+   
+    Snapshot's textual representation is [xmin]:[xmax]:[xip_list]
+    for example 10:20:10,14,15 means
+    xmin=10 xmax=20 xip_list=10,14,15.
+   
+
+   
+    Functions for getting and querying transaction ids and snapshots are
+    described in .
+   
+  
+
   
    <acronym>UUID</acronym> Type
 
index 34e9d56e65955b8fc3c544943d3bdbdc95fdc8ae..ad91d6d6af30e47f9005d206ff2b0287a2040ea9 100644 (file)
@@ -1,4 +1,4 @@
-
+
 
  
   Functions and Operators
@@ -11490,6 +11490,11 @@ SELECT pg_type_is_visible('myschema.widget'::regtype);
     as well.
    
 
+  
+
+  
+   Transaction ID and Snapshot Functions
+
    
     txid_current
    
@@ -11562,20 +11567,23 @@ SELECT pg_type_is_visible('myschema.widget'::regtype);
    
 
    
-    The internal transaction ID type (xid) is 32 bits wide and so
-    it wraps around every 4 billion transactions.  However, these functions
-    export a 64-bit format that is extended with an epoch counter
-    so that it will not wrap around for the life of an installation.
+    The internal transaction ID type (xid) is 32 bits wide and
+    so it wraps around every 4 billion transactions.  However, these
+    functions export a 64-bit format that is extended with an
+    epoch counter so that it will not wrap around for the life
+    of an installation.  The main use of these functions is to determine
+    which transactions were committed between two snapshots.
    
+
   
 
-  System Administration Functions
 
+   System Administration Functions
 
-  
-    shows the functions
-   available to query and alter run-time configuration parameters.
-  
+   
+     shows the functions
+    available to query and alter run-time configuration parameters.
+   
 
    
     Configuration Settings Functions