I'm reading the code in tqual.c and find that this comment doesn't seem to match the code. CommandId always seems to be compared with >= or <= rather than equality as the comment says.
I'm not even sure I have these operators right as the expression as written here is in a few places the converse case that the code actually tests. It's also pretty confusing. I'm not so much submitting this patch to try to correct it as to verify my understanding of the code. *** tqual.c 14 Sep 2006 13:54:45 +0100 1.96 --- tqual.c 15 Sep 2006 15:50:41 +0100 *************** *** 254,269 **** * The satisfaction of "now" requires the following: * * ((Xmin == my-transaction && changed by the current transaction ! * Cmin != my-command && but not by this command, and * (Xmax is null || the row has not been deleted, or * (Xmax == my-transaction && it was deleted by the current transaction ! * Cmax != my-command))) but not by this command, * || or * * (Xmin is committed && the row was modified by a committed transaction, and * (Xmax is null || the row has not been deleted, or * (Xmax == my-transaction && the row is being deleted by this command, or ! * Cmax == my-command) || * (Xmax is not committed && the row was deleted by another transaction * Xmax != my-transaction)))) that has not been committed * --- 254,269 ---- * The satisfaction of "now" requires the following: * * ((Xmin == my-transaction && changed by the current transaction ! * Cmin < my-command && by an earlier command than this scan, and * (Xmax is null || the row has not been deleted, or * (Xmax == my-transaction && it was deleted by the current transaction ! * Cmax >= my-command))) but not by a command before this scan * || or * * (Xmin is committed && the row was modified by a committed transaction, and * (Xmax is null || the row has not been deleted, or * (Xmax == my-transaction && the row is being deleted by an earlier command ! * Cmax >= my-command) || * (Xmax is not committed && the row was deleted by another transaction * Xmax != my-transaction)))) that has not been committed * -- Gregory Stark EnterpriseDB http://www.enterprisedb.com ---------------------------(end of broadcast)--------------------------- TIP 4: Have you searched our list archives? http://archives.postgresql.org