|
1 |
| -<!-- $PostgreSQL: pgsql/doc/src/sgml/func.sgml,v 1.400 2007/10/11 02:43:55 momjian Exp $ --> |
| 1 | +<!-- $PostgreSQL: pgsql/doc/src/sgml/func.sgml,v 1.401 2007/10/13 23:06:26 tgl Exp $ --> |
2 | 2 |
|
3 | 3 | <chapter id="functions">
|
4 | 4 | <title>Functions and Operators</title>
|
@@ -12048,6 +12048,84 @@ SELECT pg_type_is_visible('myschema.widget'::regtype);
|
12048 | 12048 | databases within each cluster and their descriptions are stored globally
|
12049 | 12049 | as well.
|
12050 | 12050 | </para>
|
| 12051 | + |
| 12052 | + <indexterm> |
| 12053 | + <primary>txid_current</primary> |
| 12054 | + </indexterm> |
| 12055 | + |
| 12056 | + <indexterm> |
| 12057 | + <primary>txid_current_snapshot</primary> |
| 12058 | + </indexterm> |
| 12059 | + |
| 12060 | + <indexterm> |
| 12061 | + <primary>txid_snapshot_xmin</primary> |
| 12062 | + </indexterm> |
| 12063 | + |
| 12064 | + <indexterm> |
| 12065 | + <primary>txid_snapshot_xmax</primary> |
| 12066 | + </indexterm> |
| 12067 | + |
| 12068 | + <indexterm> |
| 12069 | + <primary>txid_snapshot_xip</primary> |
| 12070 | + </indexterm> |
| 12071 | + |
| 12072 | + <indexterm> |
| 12073 | + <primary>txid_visible_in_snapshot</primary> |
| 12074 | + </indexterm> |
| 12075 | + |
| 12076 | + <para> |
| 12077 | + The functions shown in <xref linkend="functions-txid-snapshot"> |
| 12078 | + export server internal transaction info to user level. |
| 12079 | + </para> |
| 12080 | + |
| 12081 | + <table id="functions-txid-snapshot"> |
| 12082 | + <title>Transaction IDs and snapshots</title> |
| 12083 | + <tgroup cols="3"> |
| 12084 | + <thead> |
| 12085 | + <row><entry>Name</entry> <entry>Return Type</entry> <entry>Description</entry></row> |
| 12086 | + </thead> |
| 12087 | + |
| 12088 | + <tbody> |
| 12089 | + <row> |
| 12090 | + <entry><literal><function>txid_current</function>()</literal></entry> |
| 12091 | + <entry><type>bigint</type></entry> |
| 12092 | + <entry>get current transaction ID</entry> |
| 12093 | + </row> |
| 12094 | + <row> |
| 12095 | + <entry><literal><function>txid_current_snapshot</function>()</literal></entry> |
| 12096 | + <entry><type>txid_snapshot</type></entry> |
| 12097 | + <entry>get current snapshot</entry> |
| 12098 | + </row> |
| 12099 | + <row> |
| 12100 | + <entry><literal><function>txid_snapshot_xmin</function>(<parameter>txid_snapshot</parameter>)</literal></entry> |
| 12101 | + <entry><type>bigint</type></entry> |
| 12102 | + <entry>get xmin of snapshot</entry> |
| 12103 | + </row> |
| 12104 | + <row> |
| 12105 | + <entry><literal><function>txid_snapshot_xmax</function>(<parameter>txid_snapshot</parameter>)</literal></entry> |
| 12106 | + <entry><type>bigint</type></entry> |
| 12107 | + <entry>get xmax of snapshot</entry> |
| 12108 | + </row> |
| 12109 | + <row> |
| 12110 | + <entry><literal><function>txid_snapshot_xip</function>(<parameter>txid_snapshot</parameter>)</literal></entry> |
| 12111 | + <entry><type>setof bigint</type></entry> |
| 12112 | + <entry>get in-progress transaction IDs in snapshot</entry> |
| 12113 | + </row> |
| 12114 | + <row> |
| 12115 | + <entry><literal><function>txid_visible_in_snapshot</function>(<parameter>bigint</parameter>, <parameter>txid_snapshot</parameter>)</literal></entry> |
| 12116 | + <entry><type>boolean</type></entry> |
| 12117 | + <entry>is transaction ID visible in snapshot?</entry> |
| 12118 | + </row> |
| 12119 | + </tbody> |
| 12120 | + </tgroup> |
| 12121 | + </table> |
| 12122 | + |
| 12123 | + <para> |
| 12124 | + The internal transaction ID type (<type>xid</>) is 32 bits wide and so |
| 12125 | + it wraps around every 4 billion transactions. However, these functions |
| 12126 | + export a 64-bit format that is extended with an <quote>epoch</> counter |
| 12127 | + so that it will not wrap around for the life of an installation. |
| 12128 | + </para> |
12051 | 12129 | </sect1>
|
12052 | 12130 |
|
12053 | 12131 | <sect1 id="functions-admin">
|
|
0 commit comments