diff options
| author | Michael Paquier <michael@paquier.xyz> | 2025-12-01 16:21:41 +0900 |
|---|---|---|
| committer | Michael Paquier <michael@paquier.xyz> | 2025-12-01 16:21:41 +0900 |
| commit | a87987cafca683e9076c424f99bae117211a83a4 (patch) | |
| tree | 09e1d464b60395f50803b6f08f4646b0e58d0779 /src/include/commands/sequence_xlog.h | |
| parent | d03668ea0566b53522cf2628ab7aa630247640a4 (diff) | |
Move WAL sequence code into its own file
This split exists for most of the other RMGRs, and makes cleaner the
separation between the WAL code, the redo code and the record
description code (already in its own file) when it comes to the sequence
RMGR. The redo and masking routines are moved to a new file,
sequence_xlog.c. All the RMGR routines are now located in a new header,
sequence_xlog.h.
This separation is useful for a different patch related to sequences
that I have been working on, where it makes a refactoring of sequence.c
easier if its RMGR routines and its core routines are split.
Reviewed-by: Heikki Linnakangas <hlinnaka@iki.fi>
Reviewed-by: Kirill Reshke <reshkekirill@gmail.com>
Discussion: https://postgr.es/m/aSfTxIWjiXkTKh1E@paquier.xyz
Diffstat (limited to 'src/include/commands/sequence_xlog.h')
| -rw-r--r-- | src/include/commands/sequence_xlog.h | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/src/include/commands/sequence_xlog.h b/src/include/commands/sequence_xlog.h new file mode 100644 index 00000000000..c8cf0112c38 --- /dev/null +++ b/src/include/commands/sequence_xlog.h @@ -0,0 +1,45 @@ +/*------------------------------------------------------------------------- + * + * sequence_xlog.h + * Sequence WAL definitions. + * + * Portions Copyright (c) 1996-2025, PostgreSQL Global Development Group + * Portions Copyright (c) 1994, Regents of the University of California + * + * src/include/commands/sequence_xlog.h + * + *------------------------------------------------------------------------- + */ + +#ifndef SEQUENCE_XLOG_H +#define SEQUENCE_XLOG_H + +#include "access/xlogreader.h" +#include "lib/stringinfo.h" + +/* Record identifier */ +#define XLOG_SEQ_LOG 0x00 + +/* + * The "special area" of a sequence's buffer page looks like this. + */ +#define SEQ_MAGIC 0x1717 + +typedef struct sequence_magic +{ + uint32 magic; +} sequence_magic; + +/* Sequence WAL record */ +typedef struct xl_seq_rec +{ + RelFileLocator locator; + /* SEQUENCE TUPLE DATA FOLLOWS AT THE END */ +} xl_seq_rec; + +extern void seq_redo(XLogReaderState *record); +extern void seq_desc(StringInfo buf, XLogReaderState *record); +extern const char *seq_identify(uint8 info); +extern void seq_mask(char *page, BlockNumber blkno); + +#endif /* SEQUENCE_XLOG_H */ |
