]> granicus.if.org Git - postgresql/blob - doc/src/sgml/ref/load.sgml
Make LOAD of an already-loaded library into a no-op, instead of attempting
[postgresql] / doc / src / sgml / ref / load.sgml
1 <!--
2 $PostgreSQL: pgsql/doc/src/sgml/ref/load.sgml,v 1.26 2009/09/03 22:11:07 tgl Exp $
3 -->
4
5 <refentry id="SQL-LOAD">
6  <refmeta>
7   <refentrytitle id="SQL-LOAD-TITLE">LOAD</refentrytitle>
8   <manvolnum>7</manvolnum>
9   <refmiscinfo>SQL - Language Statements</refmiscinfo>
10  </refmeta>
11
12  <refnamediv>
13   <refname>LOAD</refname>
14   <refpurpose>load a shared library file</refpurpose>
15  </refnamediv>
16
17  <indexterm zone="sql-load">
18   <primary>LOAD</primary>
19  </indexterm>
20
21  <refsynopsisdiv>
22 <synopsis>
23 LOAD '<replaceable class="PARAMETER">filename</replaceable>'
24 </synopsis>
25  </refsynopsisdiv>
26
27  <refsect1 id="sql-load-description">
28   <title>Description</title>
29
30   <para>
31    This command loads a shared library file into the <productname>PostgreSQL</>
32    server's address space.  If the file has been loaded already,
33    the command does nothing.  Shared library files that contain C functions
34    are automatically loaded whenever one of their functions is called.
35    Therefore, an explicit <command>LOAD</> is usually only needed to
36    load a library that modifies the server's behavior through <quote>hooks</>
37    rather than providing a set of functions.
38   </para>
39
40   <para>
41    The file name is specified in the same way as for shared library
42    names in <xref linkend="sql-createfunction" endterm="sql-createfunction-title">; in particular, one
43    can rely on a search path and automatic addition of the system's standard
44    shared library file name extension.  See <xref linkend="xfunc-c"> for
45    more information on this topic.
46   </para>
47
48   <indexterm>
49    <primary><filename>$libdir/plugins</></primary>
50   </indexterm>
51
52   <para>
53    Non-superusers can only apply <command>LOAD</> to library files
54    located in <filename>$libdir/plugins/</> &mdash; the specified
55    <replaceable class="PARAMETER">filename</replaceable> must begin
56    with exactly that string.  (It is the database administrator's
57    responsibility to ensure that only <quote>safe</> libraries
58    are installed there.)
59   </para>
60  </refsect1>
61
62  <refsect1 id="sql-load-compat">
63   <title>Compatibility</title>
64
65   <para>
66    <command>LOAD</command> is a <productname>PostgreSQL</productname>
67    extension.
68   </para>
69  </refsect1>
70
71
72  <refsect1>
73   <title>See Also</title>
74
75   <para>
76    <xref linkend="sql-createfunction" endterm="sql-createfunction-title">
77   </para>
78  </refsect1>
79 </refentry>