PostgreSQL Source Code  git master
heapdesc.c File Reference
#include "postgres.h"
#include "access/heapam_xlog.h"
#include "access/rmgrdesc_utils.h"
Include dependency graph for heapdesc.c:

Go to the source code of this file.

Functions

static void infobits_desc (StringInfo buf, uint8 infobits, const char *keyname)
 
static void truncate_flags_desc (StringInfo buf, uint8 flags)
 
static void plan_elem_desc (StringInfo buf, void *plan, void *data)
 
void heap_desc (StringInfo buf, XLogReaderState *record)
 
void heap2_desc (StringInfo buf, XLogReaderState *record)
 
const char * heap_identify (uint8 info)
 
const char * heap2_identify (uint8 info)
 

Function Documentation

◆ heap2_desc()

void heap2_desc ( StringInfo  buf,
XLogReaderState record 
)

Definition at line 172 of file heapdesc.c.

173 {
174  char *rec = XLogRecGetData(record);
175  uint8 info = XLogRecGetInfo(record) & ~XLR_INFO_MASK;
176 
177  info &= XLOG_HEAP_OPMASK;
178  if (info == XLOG_HEAP2_PRUNE)
179  {
180  xl_heap_prune *xlrec = (xl_heap_prune *) rec;
181 
182  appendStringInfo(buf, "snapshotConflictHorizon: %u, nredirected: %u, ndead: %u, isCatalogRel: %c",
184  xlrec->nredirected,
185  xlrec->ndead,
186  xlrec->isCatalogRel ? 'T' : 'F');
187 
188  if (XLogRecHasBlockData(record, 0))
189  {
190  OffsetNumber *end;
191  OffsetNumber *redirected;
192  OffsetNumber *nowdead;
193  OffsetNumber *nowunused;
194  int nredirected;
195  int nunused;
196  Size datalen;
197 
198  redirected = (OffsetNumber *) XLogRecGetBlockData(record, 0,
199  &datalen);
200 
201  nredirected = xlrec->nredirected;
202  end = (OffsetNumber *) ((char *) redirected + datalen);
203  nowdead = redirected + (nredirected * 2);
204  nowunused = nowdead + xlrec->ndead;
205  nunused = (end - nowunused);
206  Assert(nunused >= 0);
207 
208  appendStringInfo(buf, ", nunused: %d", nunused);
209 
210  appendStringInfoString(buf, ", redirected:");
211  array_desc(buf, redirected, sizeof(OffsetNumber) * 2,
212  nredirected, &redirect_elem_desc, NULL);
213  appendStringInfoString(buf, ", dead:");
214  array_desc(buf, nowdead, sizeof(OffsetNumber), xlrec->ndead,
215  &offset_elem_desc, NULL);
216  appendStringInfoString(buf, ", unused:");
217  array_desc(buf, nowunused, sizeof(OffsetNumber), nunused,
218  &offset_elem_desc, NULL);
219  }
220  }
221  else if (info == XLOG_HEAP2_VACUUM)
222  {
223  xl_heap_vacuum *xlrec = (xl_heap_vacuum *) rec;
224 
225  appendStringInfo(buf, "nunused: %u", xlrec->nunused);
226 
227  if (XLogRecHasBlockData(record, 0))
228  {
229  OffsetNumber *nowunused;
230 
231  nowunused = (OffsetNumber *) XLogRecGetBlockData(record, 0, NULL);
232 
233  appendStringInfoString(buf, ", unused:");
234  array_desc(buf, nowunused, sizeof(OffsetNumber), xlrec->nunused,
235  &offset_elem_desc, NULL);
236  }
237  }
238  else if (info == XLOG_HEAP2_FREEZE_PAGE)
239  {
240  xl_heap_freeze_page *xlrec = (xl_heap_freeze_page *) rec;
241 
242  appendStringInfo(buf, "snapshotConflictHorizon: %u, nplans: %u, isCatalogRel: %c",
243  xlrec->snapshotConflictHorizon, xlrec->nplans,
244  xlrec->isCatalogRel ? 'T' : 'F');
245 
246  if (XLogRecHasBlockData(record, 0))
247  {
248  xl_heap_freeze_plan *plans;
249  OffsetNumber *offsets;
250 
251  plans = (xl_heap_freeze_plan *) XLogRecGetBlockData(record, 0, NULL);
252  offsets = (OffsetNumber *) ((char *) plans +
253  (xlrec->nplans *
254  sizeof(xl_heap_freeze_plan)));
255  appendStringInfoString(buf, ", plans:");
256  array_desc(buf, plans, sizeof(xl_heap_freeze_plan), xlrec->nplans,
257  &plan_elem_desc, &offsets);
258  }
259  }
260  else if (info == XLOG_HEAP2_VISIBLE)
261  {
262  xl_heap_visible *xlrec = (xl_heap_visible *) rec;
263 
264  appendStringInfo(buf, "snapshotConflictHorizon: %u, flags: 0x%02X",
265  xlrec->snapshotConflictHorizon, xlrec->flags);
266  }
267  else if (info == XLOG_HEAP2_MULTI_INSERT)
268  {
270  bool isinit = (XLogRecGetInfo(record) & XLOG_HEAP_INIT_PAGE) != 0;
271 
272  appendStringInfo(buf, "ntuples: %d, flags: 0x%02X", xlrec->ntuples,
273  xlrec->flags);
274 
275  if (XLogRecHasBlockData(record, 0) && !isinit)
276  {
277  appendStringInfoString(buf, ", offsets:");
278  array_desc(buf, xlrec->offsets, sizeof(OffsetNumber),
279  xlrec->ntuples, &offset_elem_desc, NULL);
280  }
281  }
282  else if (info == XLOG_HEAP2_LOCK_UPDATED)
283  {
285 
286  appendStringInfo(buf, "xmax: %u, off: %u, ",
287  xlrec->xmax, xlrec->offnum);
288  infobits_desc(buf, xlrec->infobits_set, "infobits");
289  appendStringInfo(buf, ", flags: 0x%02X", xlrec->flags);
290  }
291  else if (info == XLOG_HEAP2_NEW_CID)
292  {
293  xl_heap_new_cid *xlrec = (xl_heap_new_cid *) rec;
294 
295  appendStringInfo(buf, "rel: %u/%u/%u, tid: %u/%u",
296  xlrec->target_locator.spcOid,
297  xlrec->target_locator.dbOid,
298  xlrec->target_locator.relNumber,
301  appendStringInfo(buf, ", cmin: %u, cmax: %u, combo: %u",
302  xlrec->cmin, xlrec->cmax, xlrec->combocid);
303  }
304 }
unsigned char uint8
Definition: c.h:493
size_t Size
Definition: c.h:594
#define XLOG_HEAP2_PRUNE
Definition: heapam_xlog.h:54
#define XLOG_HEAP2_MULTI_INSERT
Definition: heapam_xlog.h:58
#define XLOG_HEAP2_VACUUM
Definition: heapam_xlog.h:55
#define XLOG_HEAP_OPMASK
Definition: heapam_xlog.h:41
struct xl_heap_freeze_plan xl_heap_freeze_plan
#define XLOG_HEAP2_LOCK_UPDATED
Definition: heapam_xlog.h:59
#define XLOG_HEAP2_FREEZE_PAGE
Definition: heapam_xlog.h:56
#define XLOG_HEAP2_NEW_CID
Definition: heapam_xlog.h:60
#define XLOG_HEAP2_VISIBLE
Definition: heapam_xlog.h:57
#define XLOG_HEAP_INIT_PAGE
Definition: heapam_xlog.h:46
static void plan_elem_desc(StringInfo buf, void *plan, void *data)
Definition: heapdesc.c:75
static void infobits_desc(StringInfo buf, uint8 infobits, const char *keyname)
Definition: heapdesc.c:25
static OffsetNumber ItemPointerGetOffsetNumber(const ItemPointerData *pointer)
Definition: itemptr.h:124
static BlockNumber ItemPointerGetBlockNumber(const ItemPointerData *pointer)
Definition: itemptr.h:103
Assert(fmt[strlen(fmt) - 1] !='\n')
uint16 OffsetNumber
Definition: off.h:24
static char * buf
Definition: pg_test_fsync.c:73
void redirect_elem_desc(StringInfo buf, void *offset, void *data)
void array_desc(StringInfo buf, void *array, size_t elem_size, int count, void(*elem_desc)(StringInfo buf, void *elem, void *data), void *data)
void offset_elem_desc(StringInfo buf, void *offset, void *data)
void appendStringInfo(StringInfo str, const char *fmt,...)
Definition: stringinfo.c:97
void appendStringInfoString(StringInfo str, const char *s)
Definition: stringinfo.c:182
RelFileNumber relNumber
TransactionId snapshotConflictHorizon
Definition: heapam_xlog.h:347
TransactionId xmax
Definition: heapam_xlog.h:293
OffsetNumber offnum
Definition: heapam_xlog.h:294
OffsetNumber offsets[FLEXIBLE_ARRAY_MEMBER]
Definition: heapam_xlog.h:179
CommandId cmin
Definition: heapam_xlog.h:380
CommandId combocid
Definition: heapam_xlog.h:382
ItemPointerData target_tid
Definition: heapam_xlog.h:388
CommandId cmax
Definition: heapam_xlog.h:381
RelFileLocator target_locator
Definition: heapam_xlog.h:387
TransactionId snapshotConflictHorizon
Definition: heapam_xlog.h:245
uint16 nredirected
Definition: heapam_xlog.h:246
TransactionId snapshotConflictHorizon
Definition: heapam_xlog.h:367
char * XLogRecGetBlockData(XLogReaderState *record, uint8 block_id, Size *len)
Definition: xlogreader.c:2027
#define XLogRecHasBlockData(decoder, block_id)
Definition: xlogreader.h:427
#define XLogRecGetInfo(decoder)
Definition: xlogreader.h:410
#define XLogRecGetData(decoder)
Definition: xlogreader.h:415
#define XLR_INFO_MASK
Definition: xlogrecord.h:62

References appendStringInfo(), appendStringInfoString(), array_desc(), Assert(), buf, xl_heap_new_cid::cmax, xl_heap_new_cid::cmin, xl_heap_new_cid::combocid, RelFileLocator::dbOid, xl_heap_multi_insert::flags, xl_heap_lock_updated::flags, xl_heap_visible::flags, infobits_desc(), xl_heap_lock_updated::infobits_set, xl_heap_prune::isCatalogRel, xl_heap_freeze_page::isCatalogRel, ItemPointerGetBlockNumber(), ItemPointerGetOffsetNumber(), xl_heap_prune::ndead, xl_heap_freeze_page::nplans, xl_heap_prune::nredirected, xl_heap_multi_insert::ntuples, xl_heap_vacuum::nunused, xl_heap_lock_updated::offnum, offset_elem_desc(), xl_heap_multi_insert::offsets, plan_elem_desc(), redirect_elem_desc(), RelFileLocator::relNumber, xl_heap_prune::snapshotConflictHorizon, xl_heap_freeze_page::snapshotConflictHorizon, xl_heap_visible::snapshotConflictHorizon, RelFileLocator::spcOid, xl_heap_new_cid::target_locator, xl_heap_new_cid::target_tid, XLOG_HEAP2_FREEZE_PAGE, XLOG_HEAP2_LOCK_UPDATED, XLOG_HEAP2_MULTI_INSERT, XLOG_HEAP2_NEW_CID, XLOG_HEAP2_PRUNE, XLOG_HEAP2_VACUUM, XLOG_HEAP2_VISIBLE, XLOG_HEAP_INIT_PAGE, XLOG_HEAP_OPMASK, XLogRecGetBlockData(), XLogRecGetData, XLogRecGetInfo, XLogRecHasBlockData, XLR_INFO_MASK, and xl_heap_lock_updated::xmax.

◆ heap2_identify()

const char* heap2_identify ( uint8  info)

Definition at line 352 of file heapdesc.c.

353 {
354  const char *id = NULL;
355 
356  switch (info & ~XLR_INFO_MASK)
357  {
358  case XLOG_HEAP2_PRUNE:
359  id = "PRUNE";
360  break;
361  case XLOG_HEAP2_VACUUM:
362  id = "VACUUM";
363  break;
365  id = "FREEZE_PAGE";
366  break;
367  case XLOG_HEAP2_VISIBLE:
368  id = "VISIBLE";
369  break;
371  id = "MULTI_INSERT";
372  break;
374  id = "MULTI_INSERT+INIT";
375  break;
377  id = "LOCK_UPDATED";
378  break;
379  case XLOG_HEAP2_NEW_CID:
380  id = "NEW_CID";
381  break;
382  case XLOG_HEAP2_REWRITE:
383  id = "REWRITE";
384  break;
385  }
386 
387  return id;
388 }
#define XLOG_HEAP2_REWRITE
Definition: heapam_xlog.h:53

References XLOG_HEAP2_FREEZE_PAGE, XLOG_HEAP2_LOCK_UPDATED, XLOG_HEAP2_MULTI_INSERT, XLOG_HEAP2_NEW_CID, XLOG_HEAP2_PRUNE, XLOG_HEAP2_REWRITE, XLOG_HEAP2_VACUUM, XLOG_HEAP2_VISIBLE, XLOG_HEAP_INIT_PAGE, and XLR_INFO_MASK.

◆ heap_desc()

void heap_desc ( StringInfo  buf,
XLogReaderState record 
)

Definition at line 95 of file heapdesc.c.

96 {
97  char *rec = XLogRecGetData(record);
98  uint8 info = XLogRecGetInfo(record) & ~XLR_INFO_MASK;
99 
100  info &= XLOG_HEAP_OPMASK;
101  if (info == XLOG_HEAP_INSERT)
102  {
103  xl_heap_insert *xlrec = (xl_heap_insert *) rec;
104 
105  appendStringInfo(buf, "off: %u, flags: 0x%02X",
106  xlrec->offnum,
107  xlrec->flags);
108  }
109  else if (info == XLOG_HEAP_DELETE)
110  {
111  xl_heap_delete *xlrec = (xl_heap_delete *) rec;
112 
113  appendStringInfo(buf, "xmax: %u, off: %u, ",
114  xlrec->xmax, xlrec->offnum);
115  infobits_desc(buf, xlrec->infobits_set, "infobits");
116  appendStringInfo(buf, ", flags: 0x%02X", xlrec->flags);
117  }
118  else if (info == XLOG_HEAP_UPDATE)
119  {
120  xl_heap_update *xlrec = (xl_heap_update *) rec;
121 
122  appendStringInfo(buf, "old_xmax: %u, old_off: %u, ",
123  xlrec->old_xmax, xlrec->old_offnum);
124  infobits_desc(buf, xlrec->old_infobits_set, "old_infobits");
125  appendStringInfo(buf, ", flags: 0x%02X, new_xmax: %u, new_off: %u",
126  xlrec->flags, xlrec->new_xmax, xlrec->new_offnum);
127  }
128  else if (info == XLOG_HEAP_HOT_UPDATE)
129  {
130  xl_heap_update *xlrec = (xl_heap_update *) rec;
131 
132  appendStringInfo(buf, "old_xmax: %u, old_off: %u, ",
133  xlrec->old_xmax, xlrec->old_offnum);
134  infobits_desc(buf, xlrec->old_infobits_set, "old_infobits");
135  appendStringInfo(buf, ", flags: 0x%02X, new_xmax: %u, new_off: %u",
136  xlrec->flags, xlrec->new_xmax, xlrec->new_offnum);
137  }
138  else if (info == XLOG_HEAP_TRUNCATE)
139  {
140  xl_heap_truncate *xlrec = (xl_heap_truncate *) rec;
141 
142  truncate_flags_desc(buf, xlrec->flags);
143  appendStringInfo(buf, ", nrelids: %u", xlrec->nrelids);
144  appendStringInfoString(buf, ", relids:");
145  array_desc(buf, xlrec->relids, sizeof(Oid), xlrec->nrelids,
146  &oid_elem_desc, NULL);
147  }
148  else if (info == XLOG_HEAP_CONFIRM)
149  {
150  xl_heap_confirm *xlrec = (xl_heap_confirm *) rec;
151 
152  appendStringInfo(buf, "off: %u", xlrec->offnum);
153  }
154  else if (info == XLOG_HEAP_LOCK)
155  {
156  xl_heap_lock *xlrec = (xl_heap_lock *) rec;
157 
158  appendStringInfo(buf, "xmax: %u, off: %u, ",
159  xlrec->xmax, xlrec->offnum);
160  infobits_desc(buf, xlrec->infobits_set, "infobits");
161  appendStringInfo(buf, ", flags: 0x%02X", xlrec->flags);
162  }
163  else if (info == XLOG_HEAP_INPLACE)
164  {
165  xl_heap_inplace *xlrec = (xl_heap_inplace *) rec;
166 
167  appendStringInfo(buf, "off: %u", xlrec->offnum);
168  }
169 }
#define XLOG_HEAP_HOT_UPDATE
Definition: heapam_xlog.h:36
#define XLOG_HEAP_DELETE
Definition: heapam_xlog.h:33
#define XLOG_HEAP_TRUNCATE
Definition: heapam_xlog.h:35
#define XLOG_HEAP_UPDATE
Definition: heapam_xlog.h:34
#define XLOG_HEAP_INPLACE
Definition: heapam_xlog.h:39
#define XLOG_HEAP_LOCK
Definition: heapam_xlog.h:38
#define XLOG_HEAP_INSERT
Definition: heapam_xlog.h:32
#define XLOG_HEAP_CONFIRM
Definition: heapam_xlog.h:37
static void truncate_flags_desc(StringInfo buf, uint8 flags)
Definition: heapdesc.c:54
unsigned int Oid
Definition: postgres_ext.h:31
void oid_elem_desc(StringInfo buf, void *relid, void *data)
OffsetNumber offnum
Definition: heapam_xlog.h:304
TransactionId xmax
Definition: heapam_xlog.h:109
OffsetNumber offnum
Definition: heapam_xlog.h:110
uint8 infobits_set
Definition: heapam_xlog.h:111
OffsetNumber offnum
Definition: heapam_xlog.h:312
OffsetNumber offnum
Definition: heapam_xlog.h:156
uint8 infobits_set
Definition: heapam_xlog.h:284
OffsetNumber offnum
Definition: heapam_xlog.h:283
TransactionId xmax
Definition: heapam_xlog.h:282
Oid relids[FLEXIBLE_ARRAY_MEMBER]
Definition: heapam_xlog.h:133
TransactionId new_xmax
Definition: heapam_xlog.h:218
uint8 old_infobits_set
Definition: heapam_xlog.h:216
TransactionId old_xmax
Definition: heapam_xlog.h:214
OffsetNumber old_offnum
Definition: heapam_xlog.h:215
OffsetNumber new_offnum
Definition: heapam_xlog.h:219

References appendStringInfo(), appendStringInfoString(), array_desc(), buf, xl_heap_delete::flags, xl_heap_truncate::flags, xl_heap_insert::flags, xl_heap_update::flags, xl_heap_lock::flags, infobits_desc(), xl_heap_delete::infobits_set, xl_heap_lock::infobits_set, xl_heap_update::new_offnum, xl_heap_update::new_xmax, xl_heap_truncate::nrelids, xl_heap_delete::offnum, xl_heap_insert::offnum, xl_heap_lock::offnum, xl_heap_confirm::offnum, xl_heap_inplace::offnum, oid_elem_desc(), xl_heap_update::old_infobits_set, xl_heap_update::old_offnum, xl_heap_update::old_xmax, xl_heap_truncate::relids, truncate_flags_desc(), XLOG_HEAP_CONFIRM, XLOG_HEAP_DELETE, XLOG_HEAP_HOT_UPDATE, XLOG_HEAP_INPLACE, XLOG_HEAP_INSERT, XLOG_HEAP_LOCK, XLOG_HEAP_OPMASK, XLOG_HEAP_TRUNCATE, XLOG_HEAP_UPDATE, XLogRecGetData, XLogRecGetInfo, XLR_INFO_MASK, xl_heap_delete::xmax, and xl_heap_lock::xmax.

◆ heap_identify()

const char* heap_identify ( uint8  info)

Definition at line 307 of file heapdesc.c.

308 {
309  const char *id = NULL;
310 
311  switch (info & ~XLR_INFO_MASK)
312  {
313  case XLOG_HEAP_INSERT:
314  id = "INSERT";
315  break;
317  id = "INSERT+INIT";
318  break;
319  case XLOG_HEAP_DELETE:
320  id = "DELETE";
321  break;
322  case XLOG_HEAP_UPDATE:
323  id = "UPDATE";
324  break;
326  id = "UPDATE+INIT";
327  break;
329  id = "HOT_UPDATE";
330  break;
332  id = "HOT_UPDATE+INIT";
333  break;
334  case XLOG_HEAP_TRUNCATE:
335  id = "TRUNCATE";
336  break;
337  case XLOG_HEAP_CONFIRM:
338  id = "HEAP_CONFIRM";
339  break;
340  case XLOG_HEAP_LOCK:
341  id = "LOCK";
342  break;
343  case XLOG_HEAP_INPLACE:
344  id = "INPLACE";
345  break;
346  }
347 
348  return id;
349 }

References XLOG_HEAP_CONFIRM, XLOG_HEAP_DELETE, XLOG_HEAP_HOT_UPDATE, XLOG_HEAP_INIT_PAGE, XLOG_HEAP_INPLACE, XLOG_HEAP_INSERT, XLOG_HEAP_LOCK, XLOG_HEAP_TRUNCATE, XLOG_HEAP_UPDATE, and XLR_INFO_MASK.

◆ infobits_desc()

static void infobits_desc ( StringInfo  buf,
uint8  infobits,
const char *  keyname 
)
static

Definition at line 25 of file heapdesc.c.

26 {
27  appendStringInfo(buf, "%s: [", keyname);
28 
29  Assert(buf->data[buf->len - 1] != ' ');
30 
31  if (infobits & XLHL_XMAX_IS_MULTI)
32  appendStringInfoString(buf, "IS_MULTI, ");
33  if (infobits & XLHL_XMAX_LOCK_ONLY)
34  appendStringInfoString(buf, "LOCK_ONLY, ");
35  if (infobits & XLHL_XMAX_EXCL_LOCK)
36  appendStringInfoString(buf, "EXCL_LOCK, ");
37  if (infobits & XLHL_XMAX_KEYSHR_LOCK)
38  appendStringInfoString(buf, "KEYSHR_LOCK, ");
39  if (infobits & XLHL_KEYS_UPDATED)
40  appendStringInfoString(buf, "KEYS_UPDATED, ");
41 
42  if (buf->data[buf->len - 1] == ' ')
43  {
44  /* Truncate-away final unneeded ", " */
45  Assert(buf->data[buf->len - 2] == ',');
46  buf->len -= 2;
47  buf->data[buf->len] = '\0';
48  }
49 
51 }
#define XLHL_XMAX_KEYSHR_LOCK
Definition: heapam_xlog.h:273
#define XLHL_XMAX_IS_MULTI
Definition: heapam_xlog.h:270
#define XLHL_XMAX_LOCK_ONLY
Definition: heapam_xlog.h:271
#define XLHL_XMAX_EXCL_LOCK
Definition: heapam_xlog.h:272
#define XLHL_KEYS_UPDATED
Definition: heapam_xlog.h:274
void appendStringInfoChar(StringInfo str, char ch)
Definition: stringinfo.c:194

References appendStringInfo(), appendStringInfoChar(), appendStringInfoString(), Assert(), buf, XLHL_KEYS_UPDATED, XLHL_XMAX_EXCL_LOCK, XLHL_XMAX_IS_MULTI, XLHL_XMAX_KEYSHR_LOCK, and XLHL_XMAX_LOCK_ONLY.

Referenced by heap2_desc(), and heap_desc().

◆ plan_elem_desc()

static void plan_elem_desc ( StringInfo  buf,
void *  plan,
void *  data 
)
static

Definition at line 75 of file heapdesc.c.

76 {
78  OffsetNumber **offsets = data;
79 
80  appendStringInfo(buf, "{ xmax: %u, infomask: %u, infomask2: %u, ntuples: %u",
81  new_plan->xmax,
82  new_plan->t_infomask, new_plan->t_infomask2,
83  new_plan->ntuples);
84 
85  appendStringInfoString(buf, ", offsets:");
86  array_desc(buf, *offsets, sizeof(OffsetNumber), new_plan->ntuples,
87  &offset_elem_desc, NULL);
88 
89  *offsets += new_plan->ntuples;
90 
92 }
const void * data
#define plan(x)
Definition: pg_regress.c:162
TransactionId xmax
Definition: heapam_xlog.h:328

References appendStringInfo(), appendStringInfoString(), array_desc(), buf, data, xl_heap_freeze_plan::ntuples, offset_elem_desc(), plan, xl_heap_freeze_plan::t_infomask, xl_heap_freeze_plan::t_infomask2, and xl_heap_freeze_plan::xmax.

Referenced by heap2_desc().

◆ truncate_flags_desc()

static void truncate_flags_desc ( StringInfo  buf,
uint8  flags 
)
static

Definition at line 54 of file heapdesc.c.

55 {
56  appendStringInfoString(buf, "flags: [");
57 
58  if (flags & XLH_TRUNCATE_CASCADE)
59  appendStringInfoString(buf, "CASCADE, ");
60  if (flags & XLH_TRUNCATE_RESTART_SEQS)
61  appendStringInfoString(buf, "RESTART_SEQS, ");
62 
63  if (buf->data[buf->len - 1] == ' ')
64  {
65  /* Truncate-away final unneeded ", " */
66  Assert(buf->data[buf->len - 2] == ',');
67  buf->len -= 2;
68  buf->data[buf->len] = '\0';
69  }
70 
72 }
#define XLH_TRUNCATE_RESTART_SEQS
Definition: heapam_xlog.h:121
#define XLH_TRUNCATE_CASCADE
Definition: heapam_xlog.h:120

References appendStringInfoChar(), appendStringInfoString(), Assert(), buf, XLH_TRUNCATE_CASCADE, and XLH_TRUNCATE_RESTART_SEQS.

Referenced by heap_desc().