Re: enum-ify resource manager's xl_info values

From: Andres Freund <andres(at)2ndquadrant(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: enum-ify resource manager's xl_info values
Date: 2013-07-22 13:02:12
Message-ID: 20130722130212.GC13444@alap2.anarazel.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2013-07-22 08:53:53 -0400, Tom Lane wrote:
> Andres Freund <andres(at)2ndquadrant(dot)com> writes:
> > Would somebody object to making the rmgr's invo value #defines like:
> > into enums?
>
> I think that will create more problems than it fixes. For one thing,
> the same field is used to store values that would need to be multiple
> independent enum types; and we also store additional bits into that
> field.

Oh, I don't want to change the definition of XLogRecord or such. I just
want to make the series of #defines an enum so you can write something
like
inf = record->xl_info & ~XLR_INFO_MASK;
switch ((XLogXactRecordType) info)
{
case ....;
}

Greetings,

Andres Freund

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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Greg Stark 2013-07-22 13:59:58 Re: Using ini file to setup replication
Previous Message Tom Lane 2013-07-22 12:53:53 Re: enum-ify resource manager's xl_info values