Re: split rm_name and rm_desc out of rmgr.c
От | Alvaro Herrera |
---|---|
Тема | Re: split rm_name and rm_desc out of rmgr.c |
Дата | |
Msg-id | 20130205011518.GN4963@alvh.no-ip.org обсуждение исходный текст |
Ответ на | Re: split rm_name and rm_desc out of rmgr.c (Tom Lane <tgl@sss.pgh.pa.us>) |
Список | pgsql-hackers |
Tom Lane wrote: > Alvaro Herrera <alvherre@2ndquadrant.com> writes: > > 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. > > This seems pretty ugly to me. > > Couldn't we do something similar to the design for SQL keyword constants, > wherein the actual data is in macros in a header file (providing exactly > one source of truth for each RM) and then various .c files can #include > that after #defining the macro as they need? See > src/include/parser/kwlist.h and the files that include that. Meh. I proposed this months ago and was shot down. I still like it better than what I propose here, so I will resurrect it. -- Álvaro Herrera http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Training & Services
В списке pgsql-hackers по дате отправления: