Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 18e3fcc

Browse files
committed
Migrate the former contrib/txid module into core. This will make it easier
for Slony and Skytools to depend on it. Per discussion.
1 parent 17333b6 commit 18e3fcc

File tree

12 files changed

+1007
-21
lines changed

12 files changed

+1007
-21
lines changed

doc/src/sgml/datatype.sgml

+7-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!-- $PostgreSQL: pgsql/doc/src/sgml/datatype.sgml,v 1.209 2007/08/31 04:52:29 momjian Exp $ -->
1+
<!-- $PostgreSQL: pgsql/doc/src/sgml/datatype.sgml,v 1.210 2007/10/13 23:06:26 tgl Exp $ -->
22

33
<chapter id="datatype">
44
<title id="datatype-title">Data Types</title>
@@ -246,6 +246,12 @@
246246
<entry>full text search document</entry>
247247
</row>
248248

249+
<row>
250+
<entry><type>txid_snapshot</type></entry>
251+
<entry></entry>
252+
<entry>user-level transaction ID snapshot</entry>
253+
</row>
254+
249255
<row>
250256
<entry><type>uuid</type></entry>
251257
<entry></entry>

doc/src/sgml/func.sgml

+79-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
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 $ -->
22

33
<chapter id="functions">
44
<title>Functions and Operators</title>
@@ -12048,6 +12048,84 @@ SELECT pg_type_is_visible('myschema.widget'::regtype);
1204812048
databases within each cluster and their descriptions are stored globally
1204912049
as well.
1205012050
</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>
1205112129
</sect1>
1205212130

1205312131
<sect1 id="functions-admin">

src/backend/utils/adt/Makefile

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#
22
# Makefile for utils/adt
33
#
4-
# $PostgreSQL: pgsql/src/backend/utils/adt/Makefile,v 1.67 2007/09/07 15:09:56 teodor Exp $
4+
# $PostgreSQL: pgsql/src/backend/utils/adt/Makefile,v 1.68 2007/10/13 23:06:26 tgl Exp $
55
#
66

77
subdir = src/backend/utils/adt
@@ -28,8 +28,8 @@ OBJS = acl.o arrayfuncs.o array_userfuncs.o arrayutils.o bool.o \
2828
ascii.o quote.o pgstatfuncs.o encode.o dbsize.o genfile.o \
2929
tsginidx.o tsgistidx.o tsquery.o tsquery_cleanup.o tsquery_gist.o \
3030
tsquery_op.o tsquery_rewrite.o tsquery_util.o tsrank.o \
31-
tsvector.o tsvector_op.o tsvector_parser.o\
32-
uuid.o xml.o
31+
tsvector.o tsvector_op.o tsvector_parser.o \
32+
txid.o uuid.o xml.o
3333

3434
like.o: like.c like_match.c
3535

0 commit comments

Comments
 (0)