Improve code around the recently added rm_identify rmgr callback.
Andres Freund <andres@anarazel.de>
Improve code around the recently added rm_identify rmgr callback. There are four weaknesses in728f152e07f998d2cb4fe5f24ec8da2c3bda98f2: * append_init() in heapdesc.c was ugly and required that rm_identify return values are only valid till the next call. Instead just add a couple more switch() cases for the INIT_PAGE cases. Now the returned value will always be valid. * a couple rm_identify() callbacks missed masking xl_info with ~XLR_INFO_MASK. * pg_xlogdump didn't map a NULL rm_identify to UNKNOWN or a similar string. * append_init() was called when id=NULL - which should never actually happen. But it's better to be careful.
Files
| Path | Change | +/− |
|---|---|---|
| contrib/pg_xlogdump/pg_xlogdump.c | modified | +6 −1 |
| src/backend/access/rmgrdesc/clogdesc.c | modified | +1 −1 |
| src/backend/access/rmgrdesc/dbasedesc.c | modified | +1 −1 |
| src/backend/access/rmgrdesc/gindesc.c | modified | +1 −1 |
| src/backend/access/rmgrdesc/gistdesc.c | modified | +1 −1 |
| src/backend/access/rmgrdesc/heapdesc.c | modified | +14 −19 |
| src/backend/access/rmgrdesc/mxactdesc.c | modified | +1 −1 |
| src/backend/access/rmgrdesc/nbtdesc.c | modified | +1 −1 |
| src/backend/access/rmgrdesc/relmapdesc.c | modified | +1 −1 |
| src/backend/access/rmgrdesc/seqdesc.c | modified | +1 −1 |
| src/backend/access/rmgrdesc/smgrdesc.c | modified | +1 −1 |
| src/backend/access/rmgrdesc/spgdesc.c | modified | +1 −1 |
| src/backend/access/rmgrdesc/standbydesc.c | modified | +1 −1 |
| src/backend/access/rmgrdesc/tblspcdesc.c | modified | +1 −1 |
| src/backend/access/rmgrdesc/xactdesc.c | modified | +1 −1 |
| src/backend/access/rmgrdesc/xlogdesc.c | modified | +1 −1 |
| src/backend/access/transam/xlog.c | modified | +2 −1 |
| src/include/access/xlog_internal.h | modified | +0 −3 |