3 <appendix id=
"contrib">
4 <title>Additional Supplied Modules
</title>
7 This appendix contains information regarding the modules that
8 can be found in the
<literal>contrib
</literal> directory of the
9 <productname>PostgreSQL<
/> distribution.
10 These include porting tools, analysis utilities,
11 and plug-in features that are not part of the core PostgreSQL system,
12 mainly because they address a limited audience or are too experimental
13 to be part of the main source tree. This does not preclude their
18 When building from the source distribution, these modules are not built
19 automatically. You can build and install all of them by running
21 <userinput>gmake
</userinput>
22 <userinput>gmake install
</userinput>
24 in the
<literal>contrib
</literal> directory of a configured source tree;
25 or to build and install
26 just one selected module, do the same in that module's subdirectory.
27 Many of the modules have regression tests, which can be executed by
30 <userinput>gmake installcheck
</userinput>
32 once you have a
<productname>PostgreSQL<
/> server running. (Note that
33 <literal>gmake check<
/> is not supported; you must have an operational
34 database server to perform these tests, and you must have built and
35 installed the module(s) to be tested.)
39 If you are using a pre-packaged version of
<productname>PostgreSQL<
/>,
40 these modules are typically made available as a separate subpackage,
41 such as
<literal>postgresql-contrib<
/>.
45 Many modules supply new user-defined functions, operators, or types.
46 To make use of one of these modules, after you have installed the code
47 you need to register the new objects in the database
48 system by running the SQL commands in the
<literal>.sql<
/> file
49 supplied by the module. For example,
52 psql -d dbname -f
<replaceable>SHAREDIR<
/>/contrib/
<replaceable>module<
/>.sql
55 Here,
<replaceable>SHAREDIR<
/> means the installation's
<quote>share<
/>
56 directory (
<literal>pg_config --sharedir<
/> will tell you what this is).
57 In most cases the script must be run by a database superuser.
61 You need to run the
<literal>.sql<
/> file in each database that you want
62 the module's facilities to be available in. Alternatively, run it in
63 database
<literal>template1<
/> so that the module will be copied into
64 subsequently-created databases by default.
68 You can modify the first command in the
<literal>.sql<
/> file to determine
69 which schema within the database the module's objects will be created in.
70 By default, they will be placed in
<literal>public<
/>.
74 After a major-version upgrade of
<productname>PostgreSQL<
/>, run the
75 installation script again, even though the module's objects might have
76 been brought forward from the old installation by dump and restore.
77 This ensures that any new functions will be available and any needed
78 corrections will be applied.