Visibility function comment addition - Mailing list pgsql-hackers

From Bruce Momjian
Subject Visibility function comment addition
Date
Msg-id 200903091308.n29D8fS10416@momjian.us
Whole thread Raw
List pgsql-hackers
I have applied the following comment to summarize the visibility rules.

I also added a URL about the Halloween problem.

--
  Bruce Momjian  <bruce@momjian.us>        http://momjian.us
  EnterpriseDB                             http://enterprisedb.com

  + If your life is a hard drive, Christ can be your backup. +
Index: src/backend/utils/time/tqual.c
===================================================================
RCS file: /cvsroot/pgsql/src/backend/utils/time/tqual.c,v
retrieving revision 1.111
diff -c -c -r1.111 tqual.c
*** src/backend/utils/time/tqual.c    1 Jan 2009 17:23:53 -0000    1.111
--- src/backend/utils/time/tqual.c    9 Mar 2009 12:39:09 -0000
***************
*** 26,31 ****
--- 26,50 ----
   * subtransactions of our own main transaction and so there can't be any
   * race condition.
   *
+  * Summary of visibility functions:
+  *
+  *   HeapTupleSatisfiesMVCC()
+  *        visible to supplied snapshot, excludes current command
+  *   HeapTupleSatisfiesNow()
+  *        visible to instant snapshot, excludes current command
+  *   HeapTupleSatisfiesUpdate()
+  *        like HeapTupleSatisfiesNow(), but with user-supplied command
+  *        counter and more complex result
+  *   HeapTupleSatisfiesSelf()
+  *        visible to instant snapshot and current command
+  *   HeapTupleSatisfiesDirty()
+  *        like HeapTupleSatisfiesSelf(), but includes open transactions
+  *   HeapTupleSatisfiesVacuum()
+  *        visible to any running transaction, used by VACUUM
+  *   HeapTupleSatisfiesToast()
+  *        visible unless part of interrupted vacuum, used for TOAST
+  *   HeapTupleSatisfiesAny()
+  *        all tuples are visible
   *
   * Portions Copyright (c) 1996-2009, PostgreSQL Global Development Group
   * Portions Copyright (c) 1994, Regents of the University of California
***************
*** 277,283 ****
   *
   * Note we do _not_ include changes made by the current command.  This
   * solves the "Halloween problem" wherein an UPDATE might try to re-update
!  * its own output tuples.
   *
   * Note:
   *        Assumes heap tuple is valid.
--- 296,302 ----
   *
   * Note we do _not_ include changes made by the current command.  This
   * solves the "Halloween problem" wherein an UPDATE might try to re-update
!  * its own output tuples, http://en.wikipedia.org/wiki/Halloween_Problem.
   *
   * Note:
   *        Assumes heap tuple is valid.

pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Updates of SE-PostgreSQL 8.4devel patches (r1704)
Next
From: Heikki Linnakangas
Date:
Subject: Re: V4 of PITR performance improvement for 8.4