Received: from localhost (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id 090BC632447 for ; Thu, 8 Jan 2009 04:18:19 -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 36313-03 for ; Thu, 8 Jan 2009 04:18:12 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from outmail137145.authsmtp.co.uk (outmail137145.authsmtp.co.uk [62.13.137.145]) by mail.postgresql.org (Postfix) with ESMTP id 3556563244F for ; Thu, 8 Jan 2009 04:18:07 -0400 (AST) Received: from mail-c187.authsmtp.com (mail-c187.authsmtp.com [62.13.128.33]) by punt9.authsmtp.com (8.14.2/8.14.2/Kp) with ESMTP id n088I4VM052856; Thu, 8 Jan 2009 08:18:04 GMT Received: from [192.168.0.3] (85-211-226-82.dyn.gotadsl.co.uk [85.211.226.82]) (authenticated bits=0) by mail.authsmtp.com (8.14.2/8.14.2/Kp) with ESMTP id n088I3hh058565; Thu, 8 Jan 2009 08:18:03 GMT Subject: Re: Incorrect description of xmax and xip in functions docs From: Simon Riggs To: Bruce Momjian Cc: pgsql-docs , Jan Wieck In-Reply-To: <200901080130.n081UIu18076@momjian.us> References: <200901080130.n081UIu18076@momjian.us> Content-Type: text/plain Date: Thu, 08 Jan 2009 08:19:19 +0000 Message-Id: <1231402759.18005.114.camel@ebony.2ndQuadrant> Mime-Version: 1.0 X-Mailer: Evolution 2.12.0 Content-Transfer-Encoding: 7bit X-Server-Quench: df145292-dd5c-11dd-8156-001185d377ca X-AuthRoute: OCdxZQATClZOTQEd DAteCiNZVAwpPBRK HVkIKg5MJUcNSQVJ NksadRtFaA1bZ1hf HGQLW11EUFV7WGt/ aw4fZQBDYEtPQQdo VlZBQE1QEQdtHhxP WB4WWmBxL11GfXZ1 Y0MsX3heWAouI0d5 R0xdF3BSMWIzdWEe BBRFfwJRdh5Kfh5E YlUrV3QKMjRJBC9q VzwfGBsKCH1+Li9S WBsAJk5aTUsQFSQ9 XwwDGjNnGkNNVyA6 P1QvLFJUDEcJekQ0 eVU8X1kEMhgUEUVS GEpWaF9z X-Authentic-SMTP: 61633235383639.squirrel.dmpriest.net.uk:1378/Kp X-Report-SPAM: If SPAM / abuse - report it at: http://www.authsmtp.com/abuse X-Virus-Status: No virus detected - but ensure you scan with your own anti-virus system. 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/2 X-Sequence-Number: 5038 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. -- Simon Riggs www.2ndQuadrant.com PostgreSQL Training, Services and Support