1<!-- 2doc/src/sgml/ref/load.sgml 3PostgreSQL documentation 4--> 5 6<refentry id="SQL-LOAD"> 7 <indexterm zone="sql-load"> 8 <primary>LOAD</primary> 9 </indexterm> 10 11 <refmeta> 12 <refentrytitle>LOAD</refentrytitle> 13 <manvolnum>7</manvolnum> 14 <refmiscinfo>SQL - Language Statements</refmiscinfo> 15 </refmeta> 16 17 <refnamediv> 18 <refname>LOAD</refname> 19 <refpurpose>load a shared library file</refpurpose> 20 </refnamediv> 21 22 <refsynopsisdiv> 23<synopsis> 24LOAD '<replaceable class="PARAMETER">filename</replaceable>' 25</synopsis> 26 </refsynopsisdiv> 27 28 <refsect1 id="sql-load-description"> 29 <title>Description</title> 30 31 <para> 32 This command loads a shared library file into the <productname>PostgreSQL</> 33 server's address space. If the file has been loaded already, 34 the command does nothing. Shared library files that contain C functions 35 are automatically loaded whenever one of their functions is called. 36 Therefore, an explicit <command>LOAD</> is usually only needed to 37 load a library that modifies the server's behavior through <quote>hooks</> 38 rather than providing a set of functions. 39 </para> 40 41 <para> 42 The library file name is typically given as just a bare file name, 43 which is sought in the server's library search path (set 44 by <xref linkend="guc-dynamic-library-path">). Alternatively it can be 45 given as a full path name. In either case the platform's standard shared 46 library file name extension may be omitted. 47 See <xref linkend="xfunc-c-dynload"> for more information on this topic. 48 </para> 49 50 <indexterm> 51 <primary><filename>$libdir/plugins</></primary> 52 </indexterm> 53 54 <para> 55 Non-superusers can only apply <command>LOAD</> to library files 56 located in <filename>$libdir/plugins/</> — the specified 57 <replaceable class="PARAMETER">filename</replaceable> must begin 58 with exactly that string. (It is the database administrator's 59 responsibility to ensure that only <quote>safe</> libraries 60 are installed there.) 61 </para> 62 </refsect1> 63 64 <refsect1 id="sql-load-compat"> 65 <title>Compatibility</title> 66 67 <para> 68 <command>LOAD</command> is a <productname>PostgreSQL</productname> 69 extension. 70 </para> 71 </refsect1> 72 73 74 <refsect1> 75 <title>See Also</title> 76 77 <para> 78 <xref linkend="sql-createfunction"> 79 </para> 80 </refsect1> 81</refentry> 82