PostgreSQL Source Code: src/include/access/heapam_xlog.h Source File (original) (raw)

1

2

3

4

5

6

7

8

9

10

11

12

13

14#ifndef HEAPAM_XLOG_H

15#define HEAPAM_XLOG_H

16

25

26

27

28

29

30

31

32

33#define XLOG_HEAP_INSERT 0x00

34#define XLOG_HEAP_DELETE 0x10

35#define XLOG_HEAP_UPDATE 0x20

36#define XLOG_HEAP_TRUNCATE 0x30

37#define XLOG_HEAP_HOT_UPDATE 0x40

38#define XLOG_HEAP_CONFIRM 0x50

39#define XLOG_HEAP_LOCK 0x60

40#define XLOG_HEAP_INPLACE 0x70

41

42#define XLOG_HEAP_OPMASK 0x70

43

44

45

46

47#define XLOG_HEAP_INIT_PAGE 0x80

48

49

50

51

52

53

54

55

56

57

58

59#define XLOG_HEAP2_REWRITE 0x00

60#define XLOG_HEAP2_PRUNE_ON_ACCESS 0x10

61#define XLOG_HEAP2_PRUNE_VACUUM_SCAN 0x20

62#define XLOG_HEAP2_PRUNE_VACUUM_CLEANUP 0x30

63#define XLOG_HEAP2_VISIBLE 0x40

64#define XLOG_HEAP2_MULTI_INSERT 0x50

65#define XLOG_HEAP2_LOCK_UPDATED 0x60

66#define XLOG_HEAP2_NEW_CID 0x70

67

68

69

70

71

72#define XLH_INSERT_ALL_VISIBLE_CLEARED (1<<0)

73#define XLH_INSERT_LAST_IN_MULTI (1<<1)

74#define XLH_INSERT_IS_SPECULATIVE (1<<2)

75#define XLH_INSERT_CONTAINS_NEW_TUPLE (1<<3)

76#define XLH_INSERT_ON_TOAST_RELATION (1<<4)

77

78

79#define XLH_INSERT_ALL_FROZEN_SET (1<<5)

80

81

82

83

84

85#define XLH_UPDATE_OLD_ALL_VISIBLE_CLEARED (1<<0)

86

87#define XLH_UPDATE_NEW_ALL_VISIBLE_CLEARED (1<<1)

88#define XLH_UPDATE_CONTAINS_OLD_TUPLE (1<<2)

89#define XLH_UPDATE_CONTAINS_OLD_KEY (1<<3)

90#define XLH_UPDATE_CONTAINS_NEW_TUPLE (1<<4)

91#define XLH_UPDATE_PREFIX_FROM_OLD (1<<5)

92#define XLH_UPDATE_SUFFIX_FROM_OLD (1<<6)

93

94

95#define XLH_UPDATE_CONTAINS_OLD \

96 (XLH_UPDATE_CONTAINS_OLD_TUPLE | XLH_UPDATE_CONTAINS_OLD_KEY)

97

98

99

100

101

102#define XLH_DELETE_ALL_VISIBLE_CLEARED (1<<0)

103#define XLH_DELETE_CONTAINS_OLD_TUPLE (1<<1)

104#define XLH_DELETE_CONTAINS_OLD_KEY (1<<2)

105#define XLH_DELETE_IS_SUPER (1<<3)

106#define XLH_DELETE_IS_PARTITION_MOVE (1<<4)

107

108

109#define XLH_DELETE_CONTAINS_OLD \

110 (XLH_DELETE_CONTAINS_OLD_TUPLE | XLH_DELETE_CONTAINS_OLD_KEY)

111

112

114{

120

121#define SizeOfHeapDelete (offsetof(xl_heap_delete, flags) + sizeof(uint8))

122

123

124

125

126#define XLH_TRUNCATE_CASCADE (1<<0)

127#define XLH_TRUNCATE_RESTART_SEQS (1<<1)

128

129

130

131

132

133

135{

141

142#define SizeOfHeapTruncate (offsetof(xl_heap_truncate, relids))

143

144

145

146

147

148

149

151{

156

157#define SizeOfHeapHeader (offsetof(xl_heap_header, t_hoff) + sizeof(uint8))

158

159

161{

164

165

167

168#define SizeOfHeapInsert (offsetof(xl_heap_insert, flags) + sizeof(uint8))

169

170

171

172

173

174

175

176

177

178

179

180

182{

187

188#define SizeOfHeapMultiInsert offsetof(xl_heap_multi_insert, offsets)

189

191{

196

198

199#define SizeOfMultiInsertTuple (offsetof(xl_multi_insert_tuple, t_hoff) + sizeof(uint8))

200

201

202

203

204

205

206

207

208

209

210

211

212

213

214

215

216

217

219{

226

227

228

229

230

232

233#define SizeOfHeapUpdate (offsetof(xl_heap_update, new_offnum) + sizeof(OffsetNumber))

234

235

236

237

238

239

240

241

242

243

244

245

246

247

248

249

250

251

252

253

254

255

256

257

258

259

260

261

262

263

264

265

266

267

268

269

270

271

272

273

274

275

276

277

278

279

280

281

282

283

284

286{

289

290

291

292

293

295

296#define SizeOfHeapPrune (offsetof(xl_heap_prune, flags) + sizeof(uint8))

297

298

299#define XLHP_IS_CATALOG_REL (1 << 1)

300

301

302

303

304

305

306

307

308

309#define XLHP_CLEANUP_LOCK (1 << 2)

310

311

312

313

314

315

316

317#define XLHP_HAS_CONFLICT_HORIZON (1 << 3)

318

319

320

321

322

323#define XLHP_HAS_FREEZE_PLANS (1 << 4)

324

325

326

327

328

329

330#define XLHP_HAS_REDIRECTIONS (1 << 5)

331#define XLHP_HAS_DEAD_ITEMS (1 << 6)

332#define XLHP_HAS_NOW_UNUSED_ITEMS (1 << 7)

333

334

335

336

337

338

339#define XLH_FREEZE_XVAC 0x02

340#define XLH_INVALID_XVAC 0x04

341

343{

348

349

352

353

354

355

356

357

358

359

360

361

362

363

364

366{

370

371

372

373

374

375

376

377

379{

383

384

385

386#define XLHL_XMAX_IS_MULTI 0x01

387#define XLHL_XMAX_LOCK_ONLY 0x02

388#define XLHL_XMAX_EXCL_LOCK 0x04

389#define XLHL_XMAX_KEYSHR_LOCK 0x08

390#define XLHL_KEYS_UPDATED 0x10

391

392

393#define XLH_LOCK_ALL_FROZEN_CLEARED 0x01

394

395

397{

403

404#define SizeOfHeapLock (offsetof(xl_heap_lock, flags) + sizeof(uint8))

405

406

408{

414

415#define SizeOfHeapLockUpdated (offsetof(xl_heap_lock_updated, flags) + sizeof(uint8))

416

417

419{

422

423#define SizeOfHeapConfirm (offsetof(xl_heap_confirm, offnum) + sizeof(OffsetNumber))

424

425

427{

432 int nmsgs;

435

436#define MinSizeOfHeapInplace (offsetof(xl_heap_inplace, nmsgs) + sizeof(int))

437

438

439

440

441

442

443

445{

449

450#define SizeOfHeapVisible (offsetof(xl_heap_visible, flags) + sizeof(uint8))

451

453{

454

455

456

457

462

463

464

465

469

470#define SizeOfHeapNewCid (offsetof(xl_heap_new_cid, target_tid) + sizeof(ItemPointerData))

471

472

474{

478 off_t offset;

482

485

494

499

500

507

508#endif

#define FLEXIBLE_ARRAY_MEMBER

struct xlhp_freeze_plan xlhp_freeze_plan

struct xl_heap_rewrite_mapping xl_heap_rewrite_mapping

XLogRecPtr log_heap_visible(Relation rel, Buffer heap_buffer, Buffer vm_buffer, TransactionId snapshotConflictHorizon, uint8 vmflags)

struct xl_heap_delete xl_heap_delete

void heap_desc(StringInfo buf, XLogReaderState *record)

void heap_redo(XLogReaderState *record)

void heap2_desc(StringInfo buf, XLogReaderState *record)

void heap_xlog_deserialize_prune_and_freeze(char *cursor, uint8 flags, int *nplans, xlhp_freeze_plan **plans, OffsetNumber **frz_offsets, int *nredirected, OffsetNumber **redirected, int *ndead, OffsetNumber **nowdead, int *nunused, OffsetNumber **nowunused)

void heap_mask(char *pagedata, BlockNumber blkno)

void HeapTupleHeaderAdvanceConflictHorizon(HeapTupleHeader tuple, TransactionId *snapshotConflictHorizon)

struct xl_heap_new_cid xl_heap_new_cid

struct xl_heap_lock xl_heap_lock

void heap_xlog_logical_rewrite(XLogReaderState *r)

const char * heap2_identify(uint8 info)

struct xl_heap_prune xl_heap_prune

struct xl_heap_multi_insert xl_heap_multi_insert

struct xl_heap_confirm xl_heap_confirm

struct xl_heap_insert xl_heap_insert

const char * heap_identify(uint8 info)

struct xlhp_freeze_plans xlhp_freeze_plans

struct xl_heap_lock_updated xl_heap_lock_updated

struct xl_heap_inplace xl_heap_inplace

struct xlhp_prune_items xlhp_prune_items

void heap2_redo(XLogReaderState *record)

struct xl_heap_header xl_heap_header

struct xl_multi_insert_tuple xl_multi_insert_tuple

struct xl_heap_visible xl_heap_visible

struct xl_heap_update xl_heap_update

struct xl_heap_truncate xl_heap_truncate

SharedInvalidationMessage msgs[FLEXIBLE_ARRAY_MEMBER]

bool relcacheInitFileInval

OffsetNumber offsets[FLEXIBLE_ARRAY_MEMBER]

ItemPointerData target_tid

RelFileLocator target_locator

Oid relids[FLEXIBLE_ARRAY_MEMBER]

TransactionId snapshotConflictHorizon

xlhp_freeze_plan plans[FLEXIBLE_ARRAY_MEMBER]

OffsetNumber data[FLEXIBLE_ARRAY_MEMBER]