enum-ify resource manager's xl_info values

From: Andres Freund <andres(at)2ndquadrant(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Subject: enum-ify resource manager's xl_info values
Date: 2013-07-22 11:21:51
Message-ID: 20130722112151.GA13444@alap2.anarazel.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Sawada Masahiko 2013-07-22 11:46:08 Re: Using ini file to setup replication
Previous Message didier 2013-07-22 10:45:05 small typo in src/backend/access/transam/xlog.c