PL instrumentation plugin support (i.e. PL/pgSQL debugger infrastructure)

Поиск
Список
Период
Сортировка
От korryd@enterprisedb.com
Тема PL instrumentation plugin support (i.e. PL/pgSQL debugger infrastructure)
Дата
Msg-id 1154079859.7099.28.camel@sakai.localdomain
обсуждение исходный текст
Ответы Re: PL instrumentation plugin support (i.e. PL/pgSQL debugger infrastructure)  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-patches
The attached patch adds support for loadable instrumentation plugins for procedural languages (as discussed at the anniversary summit). It also adds plugin support to the PL/pgSQL language handler.

We are using this plugin mechanism to load the PL/pgSQL debugger on demand (the debugger is not part of this patch, the patch is just the infrastructure that we need to load various instrumentation plugins).  We will also post some sample plugins (a PL/pgSQL profiler and a simple tracer), probably at the edb-debugger pgFoundry project site so you can see how to use the plugin mechanism.

A couple of notes:  to use a plugin, you must define a custom GUC variable that specifies the name of the shared-object that implements the plugin.  For example, to use the PL/pgSQL profiler (which is implement in $libdir/plugin_profiler.so), you would add the following to postgresql.conf

    custom_variable_classes = 'plpgsql'
   
    plpgsql.plugin = 'plugin_profiler'

The plpgsql.plugin variable is treated as an SUSET variable so you must be a superuser to change plugins.

Also, we define a helper function (in fmgr.c) named load_pl_plugin() that a language handler can use to load a plugin.  The plugin requires the name of the GUC variable (plplgsql.plugin, pljava.plugin, plperl.pluhgN, etc.) and a pointer to a language-specific struct that the plugin fills in with a set of function pointers (presumably, the language handler will call those functions at appropriate points in time).


            -- Korry


Вложения

В списке pgsql-patches по дате отправления:

Предыдущее
От: "Joachim Wieland"
Дата:
Сообщение: regression tests for guc SET
Следующее
От: Alvaro Herrera
Дата:
Сообщение: Re: [HACKERS] pgstattuple extension for indexes