mirror of
https://github.com/postgres/postgres.git
synced 2025-11-10 17:42:29 +03:00
Add rmgr callback to name xlog record types for display purposes.
This is primarily useful for the upcoming pg_xlogdump --stats feature, but also allows to remove some duplicated code in the rmgr_desc routines. Due to the separation and harmonization, the output of dipsplayed records changes somewhat. But since this isn't enduser oriented content that's ok. It's potentially desirable to further change pg_xlogdump's display of records. It previously wasn't possible to show the record type separately from the description forcing it to be in the last column. But that's better done in a separate commit. Author: Abhijit Menon-Sen, slightly editorialized by me Reviewed-By: Álvaro Herrera, Andres Freund, and Heikki Linnakangas Discussion: 20140604104716.GA3989@toroid.org
This commit is contained in:
@@ -27,15 +27,30 @@ tblspc_desc(StringInfo buf, XLogRecord *record)
|
||||
{
|
||||
xl_tblspc_create_rec *xlrec = (xl_tblspc_create_rec *) rec;
|
||||
|
||||
appendStringInfo(buf, "create tablespace: %u \"%s\"",
|
||||
xlrec->ts_id, xlrec->ts_path);
|
||||
appendStringInfo(buf, "%u \"%s\"", xlrec->ts_id, xlrec->ts_path);
|
||||
}
|
||||
else if (info == XLOG_TBLSPC_DROP)
|
||||
{
|
||||
xl_tblspc_drop_rec *xlrec = (xl_tblspc_drop_rec *) rec;
|
||||
|
||||
appendStringInfo(buf, "drop tablespace: %u", xlrec->ts_id);
|
||||
appendStringInfo(buf, "%u", xlrec->ts_id);
|
||||
}
|
||||
else
|
||||
appendStringInfoString(buf, "UNKNOWN");
|
||||
}
|
||||
|
||||
const char *
|
||||
tblspc_identify(uint8 info)
|
||||
{
|
||||
const char *id = NULL;
|
||||
|
||||
switch (info)
|
||||
{
|
||||
case XLOG_TBLSPC_CREATE:
|
||||
id = "CREATE";
|
||||
break;
|
||||
case XLOG_TBLSPC_DROP:
|
||||
id = "DROP";
|
||||
break;
|
||||
}
|
||||
|
||||
return id;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user