1
- <!-- $PostgreSQL: pgsql/doc/src/sgml/func.sgml,v 1.409 2007/11/05 16:57:23 momjian Exp $ -->
1
+ <!-- $PostgreSQL: pgsql/doc/src/sgml/func.sgml,v 1.410 2007/11/05 17:40:21 tgl Exp $ -->
2
2
3
3
<chapter id="functions">
4
4
<title>Functions and Operators</title>
@@ -11514,6 +11514,13 @@ SELECT pg_type_is_visible('myschema.widget'::regtype);
11514
11514
<primary>txid_visible_in_snapshot</primary>
11515
11515
</indexterm>
11516
11516
11517
+ <para>
11518
+ The functions shown in <xref linkend="functions-txid-snapshot">
11519
+ export server internal transaction information to user level. The main
11520
+ use of these functions is to determine which transactions were committed
11521
+ between two snapshots.
11522
+ </para>
11523
+
11517
11524
<table id="functions-txid-snapshot">
11518
11525
<title>Transaction IDs and snapshots</title>
11519
11526
<tgroup cols="3">
@@ -11557,27 +11564,22 @@ SELECT pg_type_is_visible('myschema.widget'::regtype);
11557
11564
</table>
11558
11565
11559
11566
<para>
11560
- The internal transaction ID type (<type>xid</>) is 32 bits wide and
11561
- so it wraps around every 4 billion transactions. However, these
11562
- functions export a 64-bit format that is extended with an
11563
- <quote>epoch</> counter so that it will not wrap around for the life
11564
- of an installation. The main use of these functions is to determine
11565
- which transactions were committed between two snapshots.
11567
+ The internal transaction ID type (<type>xid</>) is 32 bits wide and so
11568
+ it wraps around every 4 billion transactions. However, these functions
11569
+ export a 64-bit format that is extended with an <quote>epoch</> counter
11570
+ so that it will not wrap around for the life of an installation.
11571
+ The data type used by these functions, <type>txid_snapshot</type>,
11572
+ stores information about transaction ID
11573
+ visibility at a particular moment in time. Its components are
11574
+ described in <xref linkend="functions-txid-snapshot-parts">.
11566
11575
</para>
11567
11576
11568
- <para>
11569
- The data type <type>txid_snapshot</type> stores info about transaction ID
11570
- visibility at a particular moment in time. The components are
11571
- described in <xref linkend="datatype-txid-snapshot-parts">.
11572
- </para>
11573
-
11574
- <table id="datatype-txid-snapshot-parts">
11577
+ <table id="functions-txid-snapshot-parts">
11575
11578
<title>Snapshot components</title>
11576
11579
<tgroup cols="2">
11577
11580
<thead>
11578
11581
<row>
11579
11582
<entry>Name</entry>
11580
- <entry>Query Function</entry>
11581
11583
<entry>Description</entry>
11582
11584
</row>
11583
11585
</thead>
@@ -11586,30 +11588,29 @@ SELECT pg_type_is_visible('myschema.widget'::regtype);
11586
11588
11587
11589
<row>
11588
11590
<entry><type>xmin</type></entry>
11589
- <entry>txid_snapshot_xmin()</entry>
11590
11591
<entry>
11591
- Earliest transaction ID that is still active. All earlier
11592
+ Earliest transaction ID (txid) that is still active. All earlier
11592
11593
transactions will either be committed and visible, or rolled
11593
11594
back and dead.
11594
11595
</entry>
11595
11596
</row>
11596
11597
11597
11598
<row>
11598
11599
<entry><type>xmax</type></entry>
11599
- <entry>txid_snapshot_xmax()</entry>
11600
11600
<entry>
11601
- Next unassigned txid. All txids later than this one are
11602
- unassigned , and thus invisible.
11601
+ First as-yet- unassigned txid. All txids later than this one are
11602
+ not yet started as of the time of the snapshot , and thus invisible.
11603
11603
</entry>
11604
11604
</row>
11605
11605
11606
11606
<row>
11607
11607
<entry><type>xip_list</type></entry>
11608
- <entry>txid_snapshot_xip()</entry>
11609
11608
<entry>
11610
- Active txids at the time of snapshot. All of them are between
11611
- xmin and xmax. A txid that is <literal>xmin <= txid <
11612
- xmax</literal> and not in this list is visible.
11609
+ Active txids at the time of the snapshot. All of them are between
11610
+ <literal>xmin</> and <literal>xmax</>. A txid that is
11611
+ <literal>xmin <= txid < xmax</literal> and not in this list was
11612
+ already completed at the time of the snapshot, and thus either visible
11613
+ or dead according to its commit status.
11613
11614
</entry>
11614
11615
</row>
11615
11616
@@ -11618,11 +11619,11 @@ SELECT pg_type_is_visible('myschema.widget'::regtype);
11618
11619
</table>
11619
11620
11620
11621
<para>
11621
- Snapshot's textual representation is <literal>[xmin]:[xmax]:[xip_list]</literal>
11622
- for example <literal>10:20:10,14,15</literal> means
11623
- <literal>xmin=10 xmax=20 xip_list=10,14,15</literal>.
11622
+ <type>txid_snapshot</>'s textual representation is
11623
+ <literal><replaceable>xmin</>:<replaceable>xmax</>:<replaceable>xip_list</></literal>.
11624
+ For example <literal>10:20:10,14,15</literal> means
11625
+ <literal>xmin=10, xmax=20, xip_list=10, 14, 15</literal>.
11624
11626
</para>
11625
-
11626
11627
</sect1>
11627
11628
11628
11629
<sect1 id="functions-admin">
0 commit comments