Re: rmgr hooks and contrib/rmgr_hook

From: ITAGAKI Takahiro <itagaki(dot)takahiro(at)oss(dot)ntt(dot)co(dot)jp>
To: Simon Riggs <simon(at)2ndQuadrant(dot)com>
Cc: List pgsql-patches <pgsql-patches(at)postgresql(dot)org>
Subject: Re: rmgr hooks and contrib/rmgr_hook
Date: 2008-09-01 03:42:08
Message-ID: 20080901121833.4A18.52131E4D@oss.ntt.co.jp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches


Simon Riggs <simon(at)2ndQuadrant(dot)com> wrote:

> 1) A refactoring of calls to Rmgr code from xlog.c, and having isolated
> the code for rmgrs then to allow rmgr plugins to modify and/or add rmgrs
> to Postgres. Includes additional code to generate log messages so we can
> see what is happening after plugin has executed.

Why do we need to set rmgr_hook in _PG_init(), and add or mofify rmgrs
in our hook functions? I think it is possible to modify RmgrTable
directly in _PG_init() instead of to have rmgr_hook. If we can do so,
the patch would be more simple, no? Am I missing something?

Index: src/backend/access/transam/rmgr.c
===================================================================
--- src/backend/access/transam/rmgr.c (head)
+++ src/backend/access/transam/rmgr.c (new)
@@ -25,1 +25,1 @@
-const RmgrData RmgrTable[RM_MAX_ID + 1] = {
+RmgrData RmgrTable[MAX_NUM_RMGRS + 1] = {

Regards,
---
ITAGAKI Takahiro
NTT Open Source Software Center

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message David Fetter 2008-09-01 04:46:29 Re: Window functions patch v04 for the September commit fest
Previous Message Tom Lane 2008-09-01 03:26:14 WIP: extend parser to show error locations in more cases

Browse pgsql-patches by date

  From Date Subject
Next Message Heikki Linnakangas 2008-09-01 06:29:29 Re: [PATCHES] VACUUM Improvements - WIP Patch
Previous Message Alvaro Herrera 2008-09-01 02:39:14 Re: posix advises ...