Received: from localhost (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id 38CA1632826 for ; Thu, 8 Jan 2009 10:46:51 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 05987-01 for ; Thu, 8 Jan 2009 10:46:42 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from momjian.us (momjian.us [70.90.9.53]) by mail.postgresql.org (Postfix) with ESMTP id B45F6632495 for ; Thu, 8 Jan 2009 10:46:41 -0400 (AST) Received: (from bruce@localhost) by momjian.us (8.11.6/8.11.6) id n08EkQN10910; Thu, 8 Jan 2009 09:46:26 -0500 (EST) From: Bruce Momjian Message-Id: <200901081446.n08EkQN10910@momjian.us> Subject: Re: Incorrect description of xmax and xip in functions docs In-Reply-To: <1231402759.18005.114.camel@ebony.2ndQuadrant> To: Simon Riggs Date: Thu, 8 Jan 2009 09:46:26 -0500 (EST) CC: pgsql-docs , Jan Wieck X-Mailer: ELM [version 2.4ME+ PL124 (25)] MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="ELM1231425986-7533-0_" Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests=none X-Spam-Level: X-Archive-Number: 200901/3 X-Sequence-Number: 5039 --ELM1231425986-7533-0_ Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="US-ASCII" Simon Riggs wrote: > > On Wed, 2009-01-07 at 20:30 -0500, Bruce Momjian wrote: > > > > The only way is to document it. > > > > Sorry, I am just getting back to this. Why would we not know if > > something is a subtransaction or if subtransactions are supported? Are > > you assuming txid_visible_in_snapshot() will be used on different > > servers? What are these txid_* functions for anyway? > > You can derive a snapshot and export it using txid_current_snapshot(). > http://developer.postgresql.org/pgdocs/postgres/functions-info.html > > You can then check whether an xid is in that snapshot by running > txid_visible_in_snapshot(). However, the check is done assuming that the > xid you are checking is a top-level xid and the answer you get is either > yes or no. > > There is no allowance made that the xid supplied as a parameter value > may have been a subtrans of one of the top-level xids listed. So the > answer *ought* to have been true, whereas the function will always > return false. > > We cannot extend txid_visible_in_snapshot() to answer correctly because > that information is not held within the snapshot datatype, nor is it > held in regular snapshots currently. So the only way to handle this is > to document the limited scope of the answer this function provides. Thank you for the clarification; I know understand. Patch attached and applied. -- Bruce Momjian http://momjian.us EnterpriseDB http://enterprisedb.com + If your life is a hard drive, Christ can be your backup. + --ELM1231425986-7533-0_ Content-Transfer-Encoding: 7bit Content-Type: text/x-diff Content-Disposition: inline; filename="/rtmp/diff" Index: doc/src/sgml/func.sgml =================================================================== RCS file: /cvsroot/pgsql/doc/src/sgml/func.sgml,v retrieving revision 1.468 diff -c -c -r1.468 func.sgml *** doc/src/sgml/func.sgml 8 Jan 2009 00:44:18 -0000 1.468 --- doc/src/sgml/func.sgml 8 Jan 2009 14:45:57 -0000 *************** *** 12473,12479 **** txid_visible_in_snapshot(bigint, txid_snapshot) boolean ! is transaction ID visible in snapshot? --- 12473,12479 ---- txid_visible_in_snapshot(bigint, txid_snapshot) boolean ! is transaction ID visible in snapshot? (do not use with subtransaction ids) --ELM1231425986-7533-0_--