1
0
mirror of https://github.com/postgres/postgres.git synced 2025-09-02 04:21:28 +03:00

Add server support for "plugin" libraries that can be used for add-on tasks

such as debugging and performance measurement.  This consists of two features:
a table of "rendezvous variables" that allows separately-loaded shared
libraries to communicate, and a new GUC setting "local_preload_libraries"
that allows libraries to be loaded into specific sessions without explicit
cooperation from the client application.  To make local_preload_libraries
as flexible as possible, we do not restrict its use to superusers; instead,
it is restricted to load only libraries stored in $libdir/plugins/.  The
existing LOAD command has also been modified to allow non-superusers to
LOAD libraries stored in this directory.

This patch also renames the existing GUC variable preload_libraries to
shared_preload_libraries (after a suggestion by Simon Riggs) and does some
code refactoring in dfmgr.c to improve clarity.

Korry Douglas, with a little help from Tom Lane.
This commit is contained in:
Tom Lane
2006-08-15 18:26:59 +00:00
parent 66541c5aa5
commit abc3120e9b
11 changed files with 353 additions and 113 deletions

View File

@@ -1,5 +1,5 @@
<!--
$PostgreSQL: pgsql/doc/src/sgml/ref/load.sgml,v 1.21 2005/01/04 00:39:53 tgl Exp $
$PostgreSQL: pgsql/doc/src/sgml/ref/load.sgml,v 1.22 2006/08/15 18:26:58 tgl Exp $
-->
<refentry id="SQL-LOAD">
@@ -44,6 +44,19 @@ LOAD '<replaceable class="PARAMETER">filename</replaceable>'
shared library file name extension. See <xref linkend="xfunc-c"> for
more information on this topic.
</para>
<indexterm>
<primary><filename>$libdir/plugins</></primary>
</indexterm>
<para>
Non-superusers may only apply <command>LOAD</> to library files
located in <filename>$libdir/plugins/</> &mdash; the specified
<replaceable class="PARAMETER">filename</replaceable> must begin
with exactly that string. (It is the database administrator's
responsibility to ensure that only <quote>safe</> libraries
are installed there.)
</para>
</refsect1>
<refsect1 id="sql-load-compat">