Skip to content

Commit c91560d

Browse files
committed
Move remaining code from tqual.[ch] to heapam.h / heapam_visibility.c.
Given these routines are heap specific, and that there will be more generic visibility support in via table AM, it makes sense to move the prototypes to heapam.h (routines like HeapTupleSatisfiesVacuum will not be exposed in a generic fashion, because they are too storage specific). Similarly, the code in tqual.c is specific to heap, so moving it into access/heap/ makes sense. Author: Andres Freund Discussion: https://postgr.es/m/20180703070645.wchpu5muyto5n647@alap3.anarazel.de
1 parent b7eda3e commit c91560d

File tree

32 files changed

+65
-101
lines changed

32 files changed

+65
-101
lines changed

contrib/pg_visibility/pg_visibility.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
#include "storage/smgr.h"
2323
#include "utils/rel.h"
2424
#include "utils/snapmgr.h"
25-
#include "utils/tqual.h"
2625

2726
PG_MODULE_MAGIC;
2827

contrib/pgrowlocks/pgrowlocks.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@
3838
#include "utils/builtins.h"
3939
#include "utils/rel.h"
4040
#include "utils/snapmgr.h"
41-
#include "utils/tqual.h"
4241
#include "utils/varlena.h"
4342

4443
PG_MODULE_MAGIC;

contrib/pgstattuple/pgstatapprox.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
*/
1313
#include "postgres.h"
1414

15+
#include "access/heapam.h"
1516
#include "access/relation.h"
1617
#include "access/transam.h"
1718
#include "access/visibilitymap.h"
@@ -26,7 +27,6 @@
2627
#include "storage/procarray.h"
2728
#include "storage/lmgr.h"
2829
#include "utils/builtins.h"
29-
#include "utils/tqual.h"
3030
#include "commands/vacuum.h"
3131

3232
PG_FUNCTION_INFO_V1(pgstattuple_approx);

contrib/pgstattuple/pgstattuple.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@
3636
#include "storage/bufmgr.h"
3737
#include "storage/lmgr.h"
3838
#include "utils/builtins.h"
39-
#include "utils/tqual.h"
4039
#include "utils/varlena.h"
4140

4241
PG_MODULE_MAGIC;

src/backend/access/heap/Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ subdir = src/backend/access/heap
1212
top_builddir = ../../../..
1313
include $(top_builddir)/src/Makefile.global
1414

15-
OBJS = heapam.o hio.o pruneheap.o rewriteheap.o syncscan.o tuptoaster.o \
16-
vacuumlazy.o visibilitymap.o
15+
OBJS = heapam.o heapam_visibility.o hio.o pruneheap.o rewriteheap.o \
16+
syncscan.o tuptoaster.o vacuumlazy.o visibilitymap.o
1717

1818
include $(top_srcdir)/src/backend/common.mk

src/backend/access/heap/heapam.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,6 @@
6666
#include "utils/lsyscache.h"
6767
#include "utils/relcache.h"
6868
#include "utils/snapmgr.h"
69-
#include "utils/tqual.h"
7069

7170

7271
/* GUC variable */
@@ -5284,8 +5283,8 @@ test_lockmode_for_conflict(MultiXactStatus status, TransactionId xid,
52845283

52855284
/*
52865285
* Note: we *must* check TransactionIdIsInProgress before
5287-
* TransactionIdDidAbort/Commit; see comment at top of tqual.c for an
5288-
* explanation.
5286+
* TransactionIdDidAbort/Commit; see comment at top of heapam_visibility.c
5287+
* for an explanation.
52895288
*/
52905289
if (TransactionIdIsCurrentTransactionId(xid))
52915290
{
@@ -6254,7 +6253,8 @@ FreezeMultiXactId(MultiXactId multi, uint16 t_infomask,
62546253
*
62556254
* As with all tuple visibility routines, it's critical to test
62566255
* TransactionIdIsInProgress before TransactionIdDidCommit,
6257-
* because of race conditions explained in detail in tqual.c.
6256+
* because of race conditions explained in detail in
6257+
* heapam_visibility.c.
62586258
*/
62596259
if (TransactionIdIsCurrentTransactionId(xid) ||
62606260
TransactionIdIsInProgress(xid))

src/backend/utils/time/tqual.c renamed to src/backend/access/heap/heapam_visibility.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*-------------------------------------------------------------------------
22
*
3-
* tqual.c
4-
* POSTGRES "time qualification" code, ie, tuple visibility rules.
3+
* heapam_visibility.c
4+
* Tuple visibility rules for tuples stored in heap.
55
*
66
* NOTE: all the HeapTupleSatisfies routines will update the tuple's
77
* "hint" status bits if we see that the inserting or deleting transaction
@@ -56,13 +56,14 @@
5656
* Portions Copyright (c) 1994, Regents of the University of California
5757
*
5858
* IDENTIFICATION
59-
* src/backend/utils/time/tqual.c
59+
* src/backend/access/heap/heapam_visibility.c
6060
*
6161
*-------------------------------------------------------------------------
6262
*/
6363

6464
#include "postgres.h"
6565

66+
#include "access/heapam.h"
6667
#include "access/htup_details.h"
6768
#include "access/multixact.h"
6869
#include "access/subtrans.h"
@@ -74,7 +75,6 @@
7475
#include "utils/builtins.h"
7576
#include "utils/combocid.h"
7677
#include "utils/snapmgr.h"
77-
#include "utils/tqual.h"
7878

7979

8080
/*

src/backend/access/heap/pruneheap.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
#include "storage/bufmgr.h"
2626
#include "utils/snapmgr.h"
2727
#include "utils/rel.h"
28-
#include "utils/tqual.h"
2928

3029
/* Working data for heap_page_prune and subroutines */
3130
typedef struct

src/backend/access/heap/rewriteheap.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,6 @@
130130

131131
#include "utils/memutils.h"
132132
#include "utils/rel.h"
133-
#include "utils/tqual.h"
134133

135134
#include "storage/procarray.h"
136135

src/backend/access/heap/tuptoaster.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@
4242
#include "utils/rel.h"
4343
#include "utils/snapmgr.h"
4444
#include "utils/typcache.h"
45-
#include "utils/tqual.h"
4645

4746

4847
#undef TOAST_DEBUG

0 commit comments

Comments
 (0)