2010-09-20 22:08:53 +02:00
|
|
|
<!-- doc/src/sgml/contrib.sgml -->
|
2007-11-14 03:36:43 +01:00
|
|
|
|
|
|
|
<appendix id="contrib">
|
|
|
|
<title>Additional Supplied Modules</title>
|
2007-11-11 00:30:46 +01:00
|
|
|
|
|
|
|
<para>
|
2012-05-09 19:39:53 +02:00
|
|
|
This appendix and the next one contain information regarding the modules that
|
2007-11-11 00:30:46 +01:00
|
|
|
can be found in the <literal>contrib</literal> directory of the
|
2017-10-09 03:44:17 +02:00
|
|
|
<productname>PostgreSQL</productname> distribution.
|
2007-11-14 03:36:43 +01:00
|
|
|
These include porting tools, analysis utilities,
|
2007-11-11 00:30:46 +01:00
|
|
|
and plug-in features that are not part of the core PostgreSQL system,
|
|
|
|
mainly because they address a limited audience or are too experimental
|
|
|
|
to be part of the main source tree. This does not preclude their
|
|
|
|
usefulness.
|
|
|
|
</para>
|
|
|
|
|
|
|
|
<para>
|
2012-05-09 19:39:53 +02:00
|
|
|
This appendix covers extensions and other server plug-in modules found in
|
2017-11-23 15:39:47 +01:00
|
|
|
<literal>contrib</literal>. <xref linkend="contrib-prog"/> covers utility
|
2012-05-09 19:39:53 +02:00
|
|
|
programs.
|
|
|
|
</para>
|
|
|
|
|
|
|
|
<para>
|
|
|
|
When building from the source distribution, these components are not built
|
2010-11-23 21:27:50 +01:00
|
|
|
automatically, unless you build the "world" target
|
2017-11-23 15:39:47 +01:00
|
|
|
(see <xref linkend="build"/>).
|
2010-01-29 00:59:52 +01:00
|
|
|
You can build and install all of them by running:
|
2007-11-14 03:36:43 +01:00
|
|
|
<screen>
|
2014-02-12 23:29:19 +01:00
|
|
|
<userinput>make</userinput>
|
|
|
|
<userinput>make install</userinput>
|
2007-11-14 03:36:43 +01:00
|
|
|
</screen>
|
|
|
|
in the <literal>contrib</literal> directory of a configured source tree;
|
|
|
|
or to build and install
|
|
|
|
just one selected module, do the same in that module's subdirectory.
|
|
|
|
Many of the modules have regression tests, which can be executed by
|
2009-04-27 18:27:36 +02:00
|
|
|
running:
|
2007-11-14 03:36:43 +01:00
|
|
|
<screen>
|
2014-02-12 23:29:19 +01:00
|
|
|
<userinput>make check</userinput>
|
2012-05-09 19:37:09 +02:00
|
|
|
</screen>
|
|
|
|
before installation or
|
|
|
|
<screen>
|
2014-02-12 23:29:19 +01:00
|
|
|
<userinput>make installcheck</userinput>
|
2007-11-14 03:36:43 +01:00
|
|
|
</screen>
|
2017-10-09 03:44:17 +02:00
|
|
|
once you have a <productname>PostgreSQL</productname> server running.
|
2007-11-14 03:36:43 +01:00
|
|
|
</para>
|
|
|
|
|
|
|
|
<para>
|
2017-10-09 03:44:17 +02:00
|
|
|
If you are using a pre-packaged version of <productname>PostgreSQL</productname>,
|
2007-11-14 03:36:43 +01:00
|
|
|
these modules are typically made available as a separate subpackage,
|
2017-10-09 03:44:17 +02:00
|
|
|
such as <literal>postgresql-contrib</literal>.
|
2007-11-14 03:36:43 +01:00
|
|
|
</para>
|
|
|
|
|
|
|
|
<para>
|
|
|
|
Many modules supply new user-defined functions, operators, or types.
|
|
|
|
To make use of one of these modules, after you have installed the code
|
2011-02-14 07:10:44 +01:00
|
|
|
you need to register the new SQL objects in the database system.
|
2020-02-13 21:02:35 +01:00
|
|
|
This is done by executing
|
2017-11-23 15:39:47 +01:00
|
|
|
a <xref linkend="sql-createextension"/> command. In a fresh database,
|
2011-02-14 07:10:44 +01:00
|
|
|
you can simply do
|
2007-11-14 03:36:43 +01:00
|
|
|
|
|
|
|
<programlisting>
|
2017-10-09 03:44:17 +02:00
|
|
|
CREATE EXTENSION <replaceable>module_name</replaceable>;
|
2007-11-14 03:36:43 +01:00
|
|
|
</programlisting>
|
|
|
|
|
2020-02-13 21:02:35 +01:00
|
|
|
This command registers the new SQL objects in the current database only,
|
|
|
|
so you need to run it in each database that you want
|
2007-11-14 03:36:43 +01:00
|
|
|
the module's facilities to be available in. Alternatively, run it in
|
2017-10-09 03:44:17 +02:00
|
|
|
database <literal>template1</literal> so that the extension will be copied into
|
2007-11-14 03:36:43 +01:00
|
|
|
subsequently-created databases by default.
|
|
|
|
</para>
|
|
|
|
|
2020-02-13 21:02:35 +01:00
|
|
|
<para>
|
|
|
|
For all these modules, <command>CREATE EXTENSION</command> must be run
|
|
|
|
by a database superuser, unless the module is
|
|
|
|
considered <quote>trusted</quote>, in which case it can be run by any
|
|
|
|
user who has <literal>CREATE</literal> privilege on the current
|
|
|
|
database. Modules that are trusted are identified as such in the
|
|
|
|
sections that follow. Generally, trusted modules are ones that cannot
|
|
|
|
provide access to outside-the-database functionality.
|
|
|
|
</para>
|
|
|
|
|
2007-11-14 03:36:43 +01:00
|
|
|
<para>
|
2011-02-14 07:10:44 +01:00
|
|
|
Many modules allow you to install their objects in a schema of your
|
|
|
|
choice. To do that, add <literal>SCHEMA
|
2017-10-09 03:44:17 +02:00
|
|
|
<replaceable>schema_name</replaceable></literal> to the <command>CREATE EXTENSION</command>
|
2011-02-14 07:10:44 +01:00
|
|
|
command. By default, the objects will be placed in your current creation
|
Document security implications of search_path and the public schema.
The ability to create like-named objects in different schemas opens up
the potential for users to change the behavior of other users' queries,
maliciously or accidentally. When you connect to a PostgreSQL server,
you should remove from your search_path any schema for which a user
other than yourself or superusers holds the CREATE privilege. If you do
not, other users holding CREATE privilege can redefine the behavior of
your commands, causing them to perform arbitrary SQL statements under
your identity. "SET search_path = ..." and "SELECT
pg_catalog.set_config(...)" are not vulnerable to such hijacking, so one
can use either as the first command of a session. As special
exceptions, the following client applications behave as documented
regardless of search_path settings and schema privileges: clusterdb
createdb createlang createuser dropdb droplang dropuser ecpg (not
programs it generates) initdb oid2name pg_archivecleanup pg_basebackup
pg_config pg_controldata pg_ctl pg_dump pg_dumpall pg_isready
pg_receivewal pg_recvlogical pg_resetwal pg_restore pg_rewind pg_standby
pg_test_fsync pg_test_timing pg_upgrade pg_waldump reindexdb vacuumdb
vacuumlo. Not included are core client programs that run user-specified
SQL commands, namely psql and pgbench. PostgreSQL encourages non-core
client applications to do likewise.
Document this in the context of libpq connections, psql connections,
dblink connections, ECPG connections, extension packaging, and schema
usage patterns. The principal defense for applications is "SELECT
pg_catalog.set_config('search_path', '', false)", and the principal
defense for databases is "REVOKE CREATE ON SCHEMA public FROM PUBLIC".
Either one is sufficient to prevent attack. After a REVOKE, consider
auditing the public schema for objects named like pg_catalog objects.
Authors of SECURITY DEFINER functions use some of the same defenses, and
the CREATE FUNCTION reference page already covered them thoroughly.
This is a good opportunity to audit SECURITY DEFINER functions for
robust security practice.
Back-patch to 9.3 (all supported versions).
Reviewed by Michael Paquier and Jonathan S. Katz. Reported by Arseniy
Sharoglazov.
Security: CVE-2018-1058
2018-02-26 16:39:44 +01:00
|
|
|
target schema, which in turn defaults to <literal>public</literal>.
|
2007-11-14 03:36:43 +01:00
|
|
|
</para>
|
|
|
|
|
2012-05-09 19:39:53 +02:00
|
|
|
<para>
|
|
|
|
Note, however, that some of these modules are not <quote>extensions</quote>
|
|
|
|
in this sense, but are loaded into the server in some other way, for instance
|
|
|
|
by way of
|
2017-11-23 15:39:47 +01:00
|
|
|
<xref linkend="guc-shared-preload-libraries"/>. See the documentation of each
|
2012-05-09 19:39:53 +02:00
|
|
|
module for details.
|
|
|
|
</para>
|
|
|
|
|
2007-11-11 00:30:46 +01:00
|
|
|
&adminpack;
|
Add amcheck extension to contrib.
This is the beginning of a collection of SQL-callable functions to
verify the integrity of data files. For now it only contains code to
verify B-Tree indexes.
This adds two SQL-callable functions, validating B-Tree consistency to
a varying degree. Check the, extensive, docs for details.
The goal is to later extend the coverage of the module to further
access methods, possibly including the heap. Once checks for
additional access methods exist, we'll likely add some "dispatch"
functions that cover multiple access methods.
Author: Peter Geoghegan, editorialized by Andres Freund
Reviewed-By: Andres Freund, Tomas Vondra, Thomas Munro,
Anastasia Lubennikova, Robert Haas, Amit Langote
Discussion: CAM3SWZQzLMhMwmBqjzK+pRKXrNUZ4w90wYMUWfkeV8mZ3Debvw@mail.gmail.com
2017-03-10 00:50:40 +01:00
|
|
|
&amcheck;
|
2010-11-27 13:22:25 +01:00
|
|
|
&auth-delay;
|
2008-11-19 03:59:28 +01:00
|
|
|
&auto-explain;
|
2022-03-15 18:24:23 +01:00
|
|
|
&basebackup-to-shell;
|
2022-02-03 19:57:27 +01:00
|
|
|
&basic-archive;
|
2016-04-01 15:42:24 +02:00
|
|
|
&bloom;
|
2009-03-26 00:20:01 +01:00
|
|
|
&btree-gin;
|
2007-11-11 00:30:46 +01:00
|
|
|
&btree-gist;
|
2008-07-29 20:31:20 +02:00
|
|
|
&citext;
|
2007-11-11 00:30:46 +01:00
|
|
|
&cube;
|
|
|
|
&dblink;
|
2007-12-02 22:13:34 +01:00
|
|
|
&dict-int;
|
|
|
|
&dict-xsyn;
|
2007-11-11 00:30:46 +01:00
|
|
|
&earthdistance;
|
2011-02-20 20:06:59 +01:00
|
|
|
&file-fdw;
|
2007-11-11 00:30:46 +01:00
|
|
|
&fuzzystrmatch;
|
|
|
|
&hstore;
|
|
|
|
&intagg;
|
|
|
|
&intarray;
|
|
|
|
&isn;
|
|
|
|
&lo;
|
|
|
|
<ree;
|
2020-09-24 19:55:47 +02:00
|
|
|
&oldsnapshot;
|
2007-11-11 00:30:46 +01:00
|
|
|
&pageinspect;
|
2009-11-18 22:57:56 +01:00
|
|
|
&passwordcheck;
|
2007-12-02 23:33:20 +01:00
|
|
|
&pgbuffercache;
|
2007-11-11 00:30:46 +01:00
|
|
|
&pgcrypto;
|
2007-12-02 23:33:20 +01:00
|
|
|
&pgfreespacemap;
|
2013-12-20 14:08:01 +01:00
|
|
|
&pgprewarm;
|
2007-11-11 00:30:46 +01:00
|
|
|
&pgrowlocks;
|
2009-01-04 23:19:59 +01:00
|
|
|
&pgstatstatements;
|
2007-11-11 00:30:46 +01:00
|
|
|
&pgstattuple;
|
New contrib module, pg_surgery, with heap surgery functions.
Sometimes it happens that the visibility information for a tuple
becomes corrupted, either due to bugs in the database software or
external factors. Provide a function heap_force_kill() that can
be used to truncate such dead tuples to dead line pointers, and
a function heap_force_freeze() that can be used to overwrite the
visibility information in such a way that the tuple becomes
all-visible.
These functions are unsafe, in that you can easily use them to
corrupt a database that was not previously corrupted, and you can
use them to further corrupt an already-corrupted database or to
destroy data. The documentation accordingly cautions against
casual use. However, in some cases they permit recovery of data
that would otherwise be very difficult to recover, or to allow a
system to continue to function when it would otherwise be difficult
to do so.
Because we may want to add other functions for performing other
kinds of surgery in the future, the new contrib module is called
pg_surgery rather than something specific to these functions. I
proposed back-patching this so that it could be more easily used
by people running existing releases who are facing these kinds of
problems, but that proposal did not attract enough support, so
no back-patch for now.
Ashutosh Sharma, reviewed and tested by Andrey M. Borodin,
M. Beena Emerson, Masahiko Sawada, Rajkumar Raghuwanshi,
Asim Praveen, and Mark Dilger, and somewhat revised by me.
Discussion: http://postgr.es/m/CA+TgmoZW1fsU-QUNCRUQMGUygBDPVeOTLCqRdQZch=EYZnctSA@mail.gmail.com
2020-09-10 17:10:55 +02:00
|
|
|
&pgsurgery;
|
2007-12-02 23:33:20 +01:00
|
|
|
&pgtrgm;
|
2016-03-08 14:38:50 +01:00
|
|
|
&pgvisibility;
|
2022-04-08 09:02:10 +02:00
|
|
|
&pgwalinspect;
|
2013-02-21 11:26:23 +01:00
|
|
|
&postgres-fdw;
|
2007-11-11 00:30:46 +01:00
|
|
|
&seg;
|
2011-01-24 02:44:48 +01:00
|
|
|
&sepgsql;
|
2007-12-03 05:18:47 +01:00
|
|
|
&contrib-spi;
|
2007-11-11 00:30:46 +01:00
|
|
|
&sslinfo;
|
|
|
|
&tablefunc;
|
2012-01-20 05:15:15 +01:00
|
|
|
&tcn;
|
Introduce logical decoding.
This feature, building on previous commits, allows the write-ahead log
stream to be decoded into a series of logical changes; that is,
inserts, updates, and deletes and the transactions which contain them.
It is capable of handling decoding even across changes to the schema
of the effected tables. The output format is controlled by a
so-called "output plugin"; an example is included. To make use of
this in a real replication system, the output plugin will need to be
modified to produce output in the format appropriate to that system,
and to perform filtering.
Currently, information can be extracted from the logical decoding
system only via SQL; future commits will add the ability to stream
changes via walsender.
Andres Freund, with review and other contributions from many other
people, including Álvaro Herrera, Abhijit Menon-Sen, Peter Gheogegan,
Kevin Grittner, Robert Haas, Heikki Linnakangas, Fujii Masao, Abhijit
Menon-Sen, Michael Paquier, Simon Riggs, Craig Ringer, and Steve
Singer.
2014-03-03 22:32:18 +01:00
|
|
|
&test-decoding;
|
2015-05-15 21:14:22 +02:00
|
|
|
&tsm-system-rows;
|
2015-05-15 21:18:57 +02:00
|
|
|
&tsm-system-time;
|
2009-08-18 12:34:39 +02:00
|
|
|
&unaccent;
|
2007-11-11 00:30:46 +01:00
|
|
|
&uuid-ossp;
|
|
|
|
&xml2;
|
|
|
|
|
2007-11-14 03:36:43 +01:00
|
|
|
</appendix>
|
2012-05-09 19:39:53 +02:00
|
|
|
|
|
|
|
<!--
|
|
|
|
These are two separate appendixes because it is difficult to mix regular
|
|
|
|
sections (for extensions) and refentries (for programs) in one chapter or
|
|
|
|
appendix. And we do want the programs as refentries so that we can produce man
|
|
|
|
pages.
|
|
|
|
-->
|
|
|
|
|
|
|
|
<appendix id="contrib-prog">
|
|
|
|
<title>Additional Supplied Programs</title>
|
|
|
|
|
|
|
|
<para>
|
|
|
|
This appendix and the previous one contain information regarding the modules that
|
|
|
|
can be found in the <literal>contrib</literal> directory of the
|
2017-11-23 15:39:47 +01:00
|
|
|
<productname>PostgreSQL</productname> distribution. See <xref linkend="contrib"/> for
|
2012-05-09 19:39:53 +02:00
|
|
|
more information about the <literal>contrib</literal> section in general and
|
|
|
|
server extensions and plug-ins found in <literal>contrib</literal>
|
|
|
|
specifically.
|
|
|
|
</para>
|
|
|
|
|
|
|
|
<para>
|
|
|
|
This appendix covers utility programs found in <literal>contrib</literal>.
|
|
|
|
Once installed, either from source or a packaging system, they are found in
|
|
|
|
the <filename>bin</filename> directory of the
|
|
|
|
<productname>PostgreSQL</productname> installation and can be used like any
|
|
|
|
other program.
|
|
|
|
</para>
|
|
|
|
|
|
|
|
<sect1 id="contrib-prog-client">
|
|
|
|
<title>Client Applications</title>
|
|
|
|
|
|
|
|
<para>
|
|
|
|
This section covers <productname>PostgreSQL</productname> client
|
|
|
|
applications in <literal>contrib</literal>. They can be run from anywhere,
|
|
|
|
independent of where the database server resides. See
|
2017-11-23 15:39:47 +01:00
|
|
|
also <xref linkend="reference-client"/> for information about client
|
2020-11-25 09:49:00 +01:00
|
|
|
applications that are part of the core <productname>PostgreSQL</productname>
|
2012-05-09 19:39:53 +02:00
|
|
|
distribution.
|
|
|
|
</para>
|
|
|
|
|
|
|
|
&oid2name;
|
|
|
|
&vacuumlo;
|
|
|
|
</sect1>
|
|
|
|
|
|
|
|
<sect1 id="contrib-prog-server">
|
|
|
|
<title>Server Applications</title>
|
|
|
|
|
|
|
|
<para>
|
2021-01-29 01:21:53 +01:00
|
|
|
Some applications run on the <productname>PostgreSQL</productname> server
|
|
|
|
itself. Currently, no such applications are included in the
|
|
|
|
<literal>contrib</literal> directory. See also <xref
|
2017-11-23 15:39:47 +01:00
|
|
|
linkend="reference-server"/> for information about server applications that
|
2020-11-25 09:49:00 +01:00
|
|
|
are part of the core <productname>PostgreSQL</productname> distribution.
|
2012-05-09 19:39:53 +02:00
|
|
|
</para>
|
|
|
|
|
|
|
|
</sect1>
|
|
|
|
</appendix>
|