pgsql: Add txid_current_ifassigned().

From: Robert Haas <rhaas(at)postgresql(dot)org>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Add txid_current_ifassigned().
Date: 2016-08-23 14:32:58
Message-ID: E1bcCl8-0005Rv-QT@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Add txid_current_ifassigned().

Add a variant of txid_current() that returns NULL if no transaction ID
is assigned. This version can be used even on a standby server,
although it will always return NULL since no transaction IDs can be
assigned during recovery.

Craig Ringer, per suggestion from Jim Nasby. Reviewed by Petr Jelinek
and by me.

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/86f31695f3b54211226949de519063bbf248e8c4

Modified Files
--------------
doc/src/sgml/func.sgml | 9 +++++++++
src/backend/utils/adt/txid.c | 21 +++++++++++++++++++++
src/include/catalog/pg_proc.h | 2 ++
src/include/utils/builtins.h | 1 +
src/test/regress/expected/txid.out | 16 ++++++++++++++++
src/test/regress/sql/txid.sql | 7 +++++++
6 files changed, 56 insertions(+)

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2016-08-23 16:10:48 pgsql: Improve SP-GiST opclass API to better support unlabeled nodes.
Previous Message Robert Haas 2016-08-23 14:07:14 pgsql: Remove duplicate word from comment.