enum-ify resource manager's xl_info values - Mailing list pgsql-hackers

From Andres Freund
Subject enum-ify resource manager's xl_info values
Date
Msg-id 20130722112151.GA13444@alap2.anarazel.de
Whole thread Raw
Responses Re: enum-ify resource manager's xl_info values
Re: enum-ify resource manager's xl_info values
List pgsql-hackers
Hi,

Would somebody object to making the rmgr's invo value #defines like:

/* XLOG info values for XLOG rmgr */
#define XLOG_CHECKPOINT_SHUTDOWN        0x00
#define XLOG_CHECKPOINT_ONLINE            0x10
#define XLOG_NOOP                        0x20
#define XLOG_NEXTOID                    0x30
#define XLOG_SWITCH                        0x40
#define XLOG_BACKUP_END                    0x50
#define XLOG_PARAMETER_CHANGE            0x60
#define XLOG_RESTORE_POINT                0x70
#define XLOG_FPW_CHANGE                    0x80
#define XLOG_END_OF_RECOVERY            0x90
#define XLOG_FPI                        0xA0

into enums? We already have a bunch of places looking at those values
and if/when changeset extraction makes it in, it's going to be one
more. Having the compiler tell you where a new value should have been
been added as well helps.

Greetings,

Andres Freund

-- Andres Freund                       http://www.2ndQuadrant.com/PostgreSQL Development, 24x7 Support, Training &
Services



pgsql-hackers by date:

Previous
From: didier
Date:
Subject: small typo in src/backend/access/transam/xlog.c
Next
From: Sawada Masahiko
Date:
Subject: Re: Using ini file to setup replication