diff options
Diffstat (limited to 'src/include')
-rw-r--r-- | src/include/access/clog.h | 1 | ||||
-rw-r--r-- | src/include/access/gin.h | 1 | ||||
-rw-r--r-- | src/include/access/gist_private.h | 1 | ||||
-rw-r--r-- | src/include/access/hash.h | 1 | ||||
-rw-r--r-- | src/include/access/heapam_xlog.h | 2 | ||||
-rw-r--r-- | src/include/access/multixact.h | 1 | ||||
-rw-r--r-- | src/include/access/nbtree.h | 1 | ||||
-rw-r--r-- | src/include/access/rmgr.h | 2 | ||||
-rw-r--r-- | src/include/access/rmgrlist.h | 34 | ||||
-rw-r--r-- | src/include/access/spgist.h | 1 | ||||
-rw-r--r-- | src/include/access/xact.h | 1 | ||||
-rw-r--r-- | src/include/access/xlog.h | 1 | ||||
-rw-r--r-- | src/include/access/xlog_internal.h | 9 | ||||
-rw-r--r-- | src/include/catalog/storage_xlog.h | 1 | ||||
-rw-r--r-- | src/include/commands/dbcommands.h | 1 | ||||
-rw-r--r-- | src/include/commands/sequence.h | 1 | ||||
-rw-r--r-- | src/include/commands/tablespace.h | 1 | ||||
-rw-r--r-- | src/include/storage/standby.h | 1 | ||||
-rw-r--r-- | src/include/utils/relmapper.h | 1 |
19 files changed, 44 insertions, 18 deletions
diff --git a/src/include/access/clog.h b/src/include/access/clog.h index be9b8675a41..8562631b54f 100644 --- a/src/include/access/clog.h +++ b/src/include/access/clog.h @@ -49,5 +49,6 @@ extern void TruncateCLOG(TransactionId oldestXact); extern void clog_redo(XLogRecPtr lsn, XLogRecord *record); extern void clog_desc(StringInfo buf, XLogRecord *record); +extern const char *clog_identify(uint8 info); #endif /* CLOG_H */ diff --git a/src/include/access/gin.h b/src/include/access/gin.h index a0b288d957a..0ebecb4140d 100644 --- a/src/include/access/gin.h +++ b/src/include/access/gin.h @@ -74,6 +74,7 @@ extern void ginUpdateStats(Relation index, const GinStatsData *stats); /* ginxlog.c */ extern void gin_redo(XLogRecPtr lsn, XLogRecord *record); extern void gin_desc(StringInfo buf, XLogRecord *record); +extern const char *gin_identify(uint8 info); extern void gin_xlog_startup(void); extern void gin_xlog_cleanup(void); diff --git a/src/include/access/gist_private.h b/src/include/access/gist_private.h index 03e9903e8a0..879f11351b0 100644 --- a/src/include/access/gist_private.h +++ b/src/include/access/gist_private.h @@ -452,6 +452,7 @@ extern SplitedPageLayout *gistSplit(Relation r, Page page, IndexTuple *itup, /* gistxlog.c */ extern void gist_redo(XLogRecPtr lsn, XLogRecord *record); extern void gist_desc(StringInfo buf, XLogRecord *record); +extern const char *gist_identify(uint8 info); extern void gist_xlog_startup(void); extern void gist_xlog_cleanup(void); diff --git a/src/include/access/hash.h b/src/include/access/hash.h index ff29fea0890..a81b9de0e61 100644 --- a/src/include/access/hash.h +++ b/src/include/access/hash.h @@ -357,5 +357,6 @@ extern OffsetNumber _hash_binsearch_last(Page page, uint32 hash_value); /* hash.c */ extern void hash_redo(XLogRecPtr lsn, XLogRecord *record); extern void hash_desc(StringInfo buf, XLogRecord *record); +extern const char *hash_identify(uint8 info); #endif /* HASH_H */ diff --git a/src/include/access/heapam_xlog.h b/src/include/access/heapam_xlog.h index 254434773ed..5ac98a5baa6 100644 --- a/src/include/access/heapam_xlog.h +++ b/src/include/access/heapam_xlog.h @@ -357,8 +357,10 @@ extern void HeapTupleHeaderAdvanceLatestRemovedXid(HeapTupleHeader tuple, extern void heap_redo(XLogRecPtr lsn, XLogRecord *record); extern void heap_desc(StringInfo buf, XLogRecord *record); +extern const char *heap_identify(uint8 info); extern void heap2_redo(XLogRecPtr lsn, XLogRecord *record); extern void heap2_desc(StringInfo buf, XLogRecord *record); +extern const char *heap2_identify(uint8 info); extern void heap_xlog_logical_rewrite(XLogRecPtr lsn, XLogRecord *r); extern XLogRecPtr log_heap_cleanup_info(RelFileNode rnode, diff --git a/src/include/access/multixact.h b/src/include/access/multixact.h index 8db773b1b58..b331447ade5 100644 --- a/src/include/access/multixact.h +++ b/src/include/access/multixact.h @@ -136,6 +136,7 @@ extern void multixact_twophase_postabort(TransactionId xid, uint16 info, extern void multixact_redo(XLogRecPtr lsn, XLogRecord *record); extern void multixact_desc(StringInfo buf, XLogRecord *record); +extern const char *multixact_identify(uint8 info); extern char *mxid_to_string(MultiXactId multi, int nmembers, MultiXactMember *members); diff --git a/src/include/access/nbtree.h b/src/include/access/nbtree.h index 9fa943f39e3..90fd6d0056a 100644 --- a/src/include/access/nbtree.h +++ b/src/include/access/nbtree.h @@ -726,5 +726,6 @@ extern void _bt_leafbuild(BTSpool *btspool, BTSpool *spool2); */ extern void btree_redo(XLogRecPtr lsn, XLogRecord *record); extern void btree_desc(StringInfo buf, XLogRecord *record); +extern const char *btree_identify(uint8 info); #endif /* NBTREE_H */ diff --git a/src/include/access/rmgr.h b/src/include/access/rmgr.h index 1b577a2050a..ff7fe62c05f 100644 --- a/src/include/access/rmgr.h +++ b/src/include/access/rmgr.h @@ -19,7 +19,7 @@ typedef uint8 RmgrId; * Note: RM_MAX_ID must fit in RmgrId; widening that type will affect the XLOG * file format. */ -#define PG_RMGR(symname,name,redo,desc,startup,cleanup) \ +#define PG_RMGR(symname,name,redo,desc,identify,startup,cleanup) \ symname, typedef enum RmgrIds diff --git a/src/include/access/rmgrlist.h b/src/include/access/rmgrlist.h index 662fb77b42a..77d4574ed17 100644 --- a/src/include/access/rmgrlist.h +++ b/src/include/access/rmgrlist.h @@ -25,20 +25,20 @@ */ /* symbol name, textual name, redo, desc, startup, cleanup */ -PG_RMGR(RM_XLOG_ID, "XLOG", xlog_redo, xlog_desc, NULL, NULL) -PG_RMGR(RM_XACT_ID, "Transaction", xact_redo, xact_desc, NULL, NULL) -PG_RMGR(RM_SMGR_ID, "Storage", smgr_redo, smgr_desc, NULL, NULL) -PG_RMGR(RM_CLOG_ID, "CLOG", clog_redo, clog_desc, NULL, NULL) -PG_RMGR(RM_DBASE_ID, "Database", dbase_redo, dbase_desc, NULL, NULL) -PG_RMGR(RM_TBLSPC_ID, "Tablespace", tblspc_redo, tblspc_desc, NULL, NULL) -PG_RMGR(RM_MULTIXACT_ID, "MultiXact", multixact_redo, multixact_desc, NULL, NULL) -PG_RMGR(RM_RELMAP_ID, "RelMap", relmap_redo, relmap_desc, NULL, NULL) -PG_RMGR(RM_STANDBY_ID, "Standby", standby_redo, standby_desc, NULL, NULL) -PG_RMGR(RM_HEAP2_ID, "Heap2", heap2_redo, heap2_desc, NULL, NULL) -PG_RMGR(RM_HEAP_ID, "Heap", heap_redo, heap_desc, NULL, NULL) -PG_RMGR(RM_BTREE_ID, "Btree", btree_redo, btree_desc, NULL, NULL) -PG_RMGR(RM_HASH_ID, "Hash", hash_redo, hash_desc, NULL, NULL) -PG_RMGR(RM_GIN_ID, "Gin", gin_redo, gin_desc, gin_xlog_startup, gin_xlog_cleanup) -PG_RMGR(RM_GIST_ID, "Gist", gist_redo, gist_desc, gist_xlog_startup, gist_xlog_cleanup) -PG_RMGR(RM_SEQ_ID, "Sequence", seq_redo, seq_desc, NULL, NULL) -PG_RMGR(RM_SPGIST_ID, "SPGist", spg_redo, spg_desc, spg_xlog_startup, spg_xlog_cleanup) +PG_RMGR(RM_XLOG_ID, "XLOG", xlog_redo, xlog_desc, xlog_identify, NULL, NULL) +PG_RMGR(RM_XACT_ID, "Transaction", xact_redo, xact_desc, xact_identify, NULL, NULL) +PG_RMGR(RM_SMGR_ID, "Storage", smgr_redo, smgr_desc, smgr_identify, NULL, NULL) +PG_RMGR(RM_CLOG_ID, "CLOG", clog_redo, clog_desc, clog_identify, NULL, NULL) +PG_RMGR(RM_DBASE_ID, "Database", dbase_redo, dbase_desc, dbase_identify, NULL, NULL) +PG_RMGR(RM_TBLSPC_ID, "Tablespace", tblspc_redo, tblspc_desc, tblspc_identify, NULL, NULL) +PG_RMGR(RM_MULTIXACT_ID, "MultiXact", multixact_redo, multixact_desc, multixact_identify, NULL, NULL) +PG_RMGR(RM_RELMAP_ID, "RelMap", relmap_redo, relmap_desc, relmap_identify, NULL, NULL) +PG_RMGR(RM_STANDBY_ID, "Standby", standby_redo, standby_desc, standby_identify, NULL, NULL) +PG_RMGR(RM_HEAP2_ID, "Heap2", heap2_redo, heap2_desc, heap2_identify, NULL, NULL) +PG_RMGR(RM_HEAP_ID, "Heap", heap_redo, heap_desc, heap_identify, NULL, NULL) +PG_RMGR(RM_BTREE_ID, "Btree", btree_redo, btree_desc, btree_identify, NULL, NULL) +PG_RMGR(RM_HASH_ID, "Hash", hash_redo, hash_desc, hash_identify, NULL, NULL) +PG_RMGR(RM_GIN_ID, "Gin", gin_redo, gin_desc, gin_identify, gin_xlog_startup, gin_xlog_cleanup) +PG_RMGR(RM_GIST_ID, "Gist", gist_redo, gist_desc, gist_identify, gist_xlog_startup, gist_xlog_cleanup) +PG_RMGR(RM_SEQ_ID, "Sequence", seq_redo, seq_desc, seq_identify, NULL, NULL) +PG_RMGR(RM_SPGIST_ID, "SPGist", spg_redo, spg_desc, spg_identify, spg_xlog_startup, spg_xlog_cleanup) diff --git a/src/include/access/spgist.h b/src/include/access/spgist.h index 7f8655cf60e..f218a83224e 100644 --- a/src/include/access/spgist.h +++ b/src/include/access/spgist.h @@ -198,6 +198,7 @@ extern Datum spgvacuumcleanup(PG_FUNCTION_ARGS); /* spgxlog.c */ extern void spg_redo(XLogRecPtr lsn, XLogRecord *record); extern void spg_desc(StringInfo buf, XLogRecord *record); +extern const char *spg_identify(uint8 info); extern void spg_xlog_startup(void); extern void spg_xlog_cleanup(void); diff --git a/src/include/access/xact.h b/src/include/access/xact.h index 2168dc3cb52..45376b47928 100644 --- a/src/include/access/xact.h +++ b/src/include/access/xact.h @@ -256,5 +256,6 @@ extern int xactGetCommittedChildren(TransactionId **ptr); extern void xact_redo(XLogRecPtr lsn, XLogRecord *record); extern void xact_desc(StringInfo buf, XLogRecord *record); +extern const char *xact_identify(uint8 info); #endif /* XACT_H */ diff --git a/src/include/access/xlog.h b/src/include/access/xlog.h index 7d6db498936..0b7bfa5f30e 100644 --- a/src/include/access/xlog.h +++ b/src/include/access/xlog.h @@ -304,6 +304,7 @@ extern Buffer RestoreBackupBlock(XLogRecPtr lsn, XLogRecord *record, extern void xlog_redo(XLogRecPtr lsn, XLogRecord *record); extern void xlog_desc(StringInfo buf, XLogRecord *record); +extern const char *xlog_identify(uint8 info); extern void issue_xlog_fsync(int fd, XLogSegNo segno); diff --git a/src/include/access/xlog_internal.h b/src/include/access/xlog_internal.h index 954114f0d54..a1452b82b8e 100644 --- a/src/include/access/xlog_internal.h +++ b/src/include/access/xlog_internal.h @@ -239,6 +239,14 @@ struct XLogRecord; * This struct must be kept in sync with the PG_RMGR definition in * rmgr.c. * + * rm_identify must return a name for the record based on xl_info (without + * reference to the rmid). For example, XLOG_BTREE_VACUUM would be named + * "VACUUM". rm_desc can then be called to obtain additional detail for the + * record, if available (e.g. the last block). + * + * The return value from rm_identify is a pointer to a statically allocated + * buffer, and only valid until the next invocation of the callback. + * * RmgrTable[] is indexed by RmgrId values (see rmgrlist.h). */ typedef struct RmgrData @@ -246,6 +254,7 @@ typedef struct RmgrData const char *rm_name; void (*rm_redo) (XLogRecPtr lsn, struct XLogRecord *rptr); void (*rm_desc) (StringInfo buf, struct XLogRecord *rptr); + const char *(*rm_identify) (uint8 info); void (*rm_startup) (void); void (*rm_cleanup) (void); } RmgrData; diff --git a/src/include/catalog/storage_xlog.h b/src/include/catalog/storage_xlog.h index 7081c990ada..5fc72358284 100644 --- a/src/include/catalog/storage_xlog.h +++ b/src/include/catalog/storage_xlog.h @@ -45,5 +45,6 @@ extern void log_smgrcreate(RelFileNode *rnode, ForkNumber forkNum); extern void smgr_redo(XLogRecPtr lsn, XLogRecord *record); extern void smgr_desc(StringInfo buf, XLogRecord *record); +extern const char *smgr_identify(uint8 info); #endif /* STORAGE_XLOG_H */ diff --git a/src/include/commands/dbcommands.h b/src/include/commands/dbcommands.h index c2380dca111..811713fb83e 100644 --- a/src/include/commands/dbcommands.h +++ b/src/include/commands/dbcommands.h @@ -64,6 +64,7 @@ extern char *get_database_name(Oid dbid); extern void dbase_redo(XLogRecPtr lsn, XLogRecord *rptr); extern void dbase_desc(StringInfo buf, XLogRecord *rptr); +extern const char *dbase_identify(uint8 info); extern void check_encoding_locale_matches(int encoding, const char *collate, const char *ctype); diff --git a/src/include/commands/sequence.h b/src/include/commands/sequence.h index 8819c00e812..914d155c9f1 100644 --- a/src/include/commands/sequence.h +++ b/src/include/commands/sequence.h @@ -78,5 +78,6 @@ extern void ResetSequenceCaches(void); extern void seq_redo(XLogRecPtr lsn, XLogRecord *rptr); extern void seq_desc(StringInfo buf, XLogRecord *rptr); +extern const char *seq_identify(uint8 info); #endif /* SEQUENCE_H */ diff --git a/src/include/commands/tablespace.h b/src/include/commands/tablespace.h index d01ae8bdf9f..0f16f40e3df 100644 --- a/src/include/commands/tablespace.h +++ b/src/include/commands/tablespace.h @@ -57,5 +57,6 @@ extern bool directory_is_empty(const char *path); extern void tblspc_redo(XLogRecPtr lsn, XLogRecord *rptr); extern void tblspc_desc(StringInfo buf, XLogRecord *rptr); +extern const char *tblspc_identify(uint8 info); #endif /* TABLESPACE_H */ diff --git a/src/include/storage/standby.h b/src/include/storage/standby.h index da22fd31499..1c63af521fe 100644 --- a/src/include/storage/standby.h +++ b/src/include/storage/standby.h @@ -83,6 +83,7 @@ typedef struct xl_running_xacts /* Recovery handlers for the Standby Rmgr (RM_STANDBY_ID) */ extern void standby_redo(XLogRecPtr lsn, XLogRecord *record); extern void standby_desc(StringInfo buf, XLogRecord *record); +extern const char *standby_identify(uint8 info); /* * Declarations for GetRunningTransactionData(). Similar to Snapshots, but diff --git a/src/include/utils/relmapper.h b/src/include/utils/relmapper.h index 76bcf18d5ab..37937ddab82 100644 --- a/src/include/utils/relmapper.h +++ b/src/include/utils/relmapper.h @@ -60,5 +60,6 @@ extern void RelationMapInitializePhase3(void); extern void relmap_redo(XLogRecPtr lsn, XLogRecord *record); extern void relmap_desc(StringInfo buf, XLogRecord *record); +extern const char *relmap_identify(uint8 info); #endif /* RELMAPPER_H */ |