Re: split rm_name and rm_desc out of rmgr.c

From: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
To: Simon Riggs <simon(at)2ndQuadrant(dot)com>
Cc: Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: split rm_name and rm_desc out of rmgr.c
Date: 2013-02-04 21:22:12
Message-ID: 20130204212212.GL4963@alvh.no-ip.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Simon Riggs wrote:
> On 4 February 2013 20:57, Alvaro Herrera <alvherre(at)2ndquadrant(dot)com> wrote:
>
> > pg_xlogdump needs access to the *_desc functions for each rmgr. We
> > already moved forward quite a bit by splitting those functions out of
> > their containing files; so now they are compilable separately. Good.
> > The remaining task is enabling the code to find those functions in the
> > first place; currently, the function pointers live in rmgr.c which is
> > not compilable by frontend code because it contains pointers to other
> > functions. Hence the attached patch splits RmgrData into two; the names
> > and rm_desc functions go into a new file which can be compiled easily by
> > frontend.
> >
> > Proposed patch attached.
>
> Not meaning to cause you extra work, but some kind of id as the first
> field of each structure would allow a cross-check that there is no
> misconfiguration.

Well, we could add the rmgr_id as the first struct member to both
tables and add an Assert() somewhere in xlog.c. However, do we really
need that? These tables are almost immutable, and failure to edit both
simultaneously should be promptly detected.

--
Álvaro Herrera http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Andrew Dunstan 2013-02-04 21:29:21 Re: json api WIP patch
Previous Message Daniel Farina 2013-02-04 21:19:32 Re: json api WIP patch