sections, rather than just calling it "/contrib/module_name".
Also update pg_test_fsync build instructions now that it is in /contrib.
- The <filename>contrib/spi> module provides several workable examples
+ The <application>spi> module provides several workable examples
of using SPI and triggers. While these functions are of some value in
their own right, they are even more useful as examples to modify for
your own purposes. The functions are general enough to be used
PostgreSQL provides storage and comparison
functions for UUIDs, but the core database does not include any
function for generating UUIDs, because no single algorithm is well
- suited for every application. The contrib module
- contrib/uuid-ossp provides functions that implement
- several standard algorithms.
+ suited for every application. The
+ linkend="uuid-ossp"> module
+ provides functions that implement several standard algorithms.
Alternatively, UUIDs could be generated by client applications or
other libraries invoked through a server-side function.
You can monitor disk space in three ways:
using the SQL functions listed in ,
- using the tools in contrib/oid2name>, or
+ using the module, or
using manual inspection of the system catalogs.
The SQL functions are the easiest to use and are generally recommended.
- contrib/oid2name> is described in .
The remainder of this section shows how to do it by inspection of the
system catalogs.
sections is to use a restore_command> that polls the archive location.
This was the only option available in versions 8.4 and below. In this
setup, set standby_mode> off, because you are implementing
- the polling required for standby operation yourself. See
- contrib/pg_standby () for a reference
+ the polling required for standby operation yourself. See the
+ module for a reference
implementation of this.
A working example of a waiting restore_command> is provided
-
as a contrib> module named pg_standby>. It
+ in the module. It
should be used as a reference on how to correctly implement the logic
described above. It can also be extended as needed to support specific
configurations and environments.
primary server and keep a query active for as long as needed to
run queries on the standby. This prevents VACUUM> from removing
recently-dead rows and so cleanup conflicts do not occur.
- This could be done using <filename>contrib/dblink> and
+ This could be done using <xref linkend="dblink"> and
pg_sleep()>, or via other mechanisms. If you do this, you
should note that this will delay cleanup of dead rows on the primary,
which may result in undesirable table bloat. However, the cleanup
- library when building contrib/uuid-ossp>.
- The library provides functions to generate
+ library when building the
+ module. The library provides functions to generate
- Use libxslt when building contrib/xml2>.
- contrib/xml2> relies on this library to perform
- XSL transformations of XML.
+ Use libxslt when building the
+ module.
xml2> relies on this library
+ to perform XSL transformations of XML.
If you already have, or suspect you have, orphaned large objects, see the
- <filename>contrib/vacuumlo> module () to help
+ <xref linkend="vacuumlo"> module to help
you clean them up. It's a good idea to run
vacuumlo>
occasionally as a back-stop to the lo_manage> trigger.
AS t1(proname name, prosrc text)
WHERE proname LIKE 'bytea%';
- The dblink> function executes a remote query (see
- contrib/dblink>). It is declared to return
+ The function
+ (part of the module>) executes
+ a remote query. It is declared to return
record> since it might be used for any kind of query.
The actual column set must be specified in the calling query so
that the parser knows, for example, what *> should
may be safely removed.
This information can be used to truncate the archive to just the
minimum required to support restart from the current restore.
- The
pg_archivecleanup> utility provided in
- contrib> (see ) serves as a
- convenient target for archive_cleanup_command> in typical
+ The module
+ is often used in archive_cleanup_command> for
single-standby configurations, for example:
archive_cleanup_command = 'pg_archivecleanup /mnt/server/archivedir %r'
Note however that if multiple standby servers are restoring from the
The following example command defines a GiST index operator class
- for the data type _int4> (array of int4). See
- <filename>contrib/intarray/> for the complete example.
+ for the data type _int4> (array of int4). See the
+ <xref linkend="intarray"> module for the complete example.
- The contrib> function library
- pgcrypto
- allows certain fields to be stored encrypted.
+ The module allows certain fields to be
+ stored encrypted.
This is useful if only some of the data is sensitive.
The client supplies the decryption key and the data is decrypted
on the server and then sent to the client.
using SPI_exec and returns the number of rows
that were processed by the command. You can find more complex
examples for SPI in the source tree in
- src/test/regress/regress.c and in
- <filename>contrib/spi.
+ src/test/regress/regress.c and in the
+ <xref linkend="contrib-spi"> module.
See src/backend/storage/freespace/README> for more details on
how the
FSM> is structured, and how it's updated and searched.
-The <filename>contrib/pg_freespacemap> module can be used to examine the
-information stored in free space maps (see ).
+The <xref linkend="pgfreespacemap"> module
+can be used to examine the information stored in free space maps.
end where it'd be useless. Filtering dictionaries are useful to partially
normalize words to simplify the task of later dictionaries. For example,
a filtering dictionary could be used to remove accents from accented
- letters, as is done by the
- contrib/unaccent>
- extension module.
+ letters, as is done by the module.
allows the implementation of very fast searches with online update.
Partitioning can be done at the database level using table inheritance,
or by distributing documents over
- servers and collecting search results using the <filename>contrib/dblink>
- extension module. The latter is possible because ranking functions use
+ servers and collecting search results using the <xref linkend="dblink">
+ module. The latter is possible because ranking functions use
only local information.
Migration from Pre-8.3 Text Search
- Applications that used the contrib/tsearch2> add-on module
- for text searching will need some adjustments to work with the
+ Applications that use the
+ module for text searching will need some adjustments to work
+ with the
built-in features:
argument lists, and all of them are now in the pg_catalog>
schema, whereas in a previous installation they would have been in
public> or another non-system schema. There is a new
- version of <filename>contrib/tsearch2> (see )
+ version of <application>tsearch2>
that provides a compatibility layer to solve most problems in this
area.
- The old <filename>contrib/tsearch2> functions and other objects
+ The old <application>tsearch2> functions and other objects
must> be suppressed when loading pg_dump>
output from a pre-8.3 database. While many of them won't load anyway,
a few will and then cause problems. One simple way to deal with this
- is to load the new <filename>contrib/tsearch2> module before restoring
+ is to load the new <application>tsearch2> module before restoring
the dump; then it will block the old objects from being loaded.
There are more complex examples in
src/test/regress/regress.c and
- in <filename>contrib/spi>.
+ in <xref linkend="contrib-spi">.
- The <literal>tsearch2> module provides backwards-compatible
+ The <application>tsearch2> module provides backwards-compatible
text search functionality for applications that used
- <filename>contrib/tsearch2> before text searching was integrated
+ <application>tsearch2> before text searching was integrated
into core
PostgreSQL in release 8.3.
Although the built-in text search features were based on
- <filename>contrib/tsearch2> and are largely similar to it,
+ <application>tsearch2> and are largely similar to it,
there are numerous small differences that will create portability
issues for existing applications:
The built-in text search data types and functions all exist within
the system schema pg_catalog>. In an installation using
- <filename>contrib/tsearch2>, these objects would usually have been in
+ <application>tsearch2>, these objects would usually have been in
the public> schema, though some users chose to place them
in a separate schema of their own. Explicitly schema-qualified
references to the objects will therefore fail in either case.
Text search configuration information has been moved into core
system catalogs that are noticeably different from the tables used
- by <filename>contrib/tsearch2>. Any applications that examined
+ by <application>tsearch2>. Any applications that examined
or modified those tables will need adjustment.
catalogs using the new text search configuration SQL commands.
The replacement tsearch2 module offers a little
bit of support for this by making it possible to load an old set
- of <filename>contrib/tsearch2> configuration tables into
+ of <application>tsearch2> configuration tables into
PostgreSQL 8.3. (Without the module,
it is not possible to load the configuration data because values in the
regprocedure> columns cannot be resolved to functions.)
The recommended way to update a pre-8.3 installation that uses
- <filename>contrib/tsearch2> is:
+ <application>tsearch2> is:
the replacement tsearch2 module into each
database that will use text search. This must be done
before> loading the dump data! If your old installation
- had the <filename>contrib/tsearch2> objects in a schema other
+ had the <application>tsearch2> objects in a schema other
than public>, be sure to adjust the
tsearch2 installation script so that the replacement
objects are created in that same schema.
Load the dump data. There will be quite a few errors reported
- due to failure to recreate the original <filename>contrib/tsearch2>
+ due to failure to recreate the original <application>tsearch2>
objects. These errors can be ignored, but this means you cannot
restore the dump in a single transaction (eg, you cannot use
pg_restore>'s -1> switch).
- Examine the contents of the restored <filename>contrib/tsearch2>
+ Examine the contents of the restored <application>tsearch2>
configuration tables (pg_ts_cfg> and so on), and
create equivalent built-in text search configurations as needed.
You may drop the old configuration tables once you've extracted
If you use this, you may also be interested in the lo_manage>
- trigger in contrib/lo> (see ).
+ trigger in the module.
lo_manage> is useful to try
to avoid creating orphaned LOs in the first place.
file systems behave suboptimally when combined with battery-backup unit
(
BBU>) disk controllers. In such setups, the synchronize
command forces all data from the controller cache to the disks,
- eliminating much of the benefit of the BBU. You can run the utility
- <filename>contrib/pg_test_fsync> in the PostgreSQL source tree to see
+ eliminating much of the benefit of the BBU. You can run the
+ <xref linkend="pgtestfsync"> module to see
if you are affected. If you are affected, the performance benefits
of the BBU can be regained by turning off write barriers in
the file system or reconfiguring the disk controller, if that is
the exception of fsync_writethrough>, which can sometimes
force a flush of the disk cache even when other options do not do so.
However, it's quite platform-specific which one will be the fastest;
- you can test option speeds using the utility contrib/pg_test_fsync>
- in the PostgreSQL source tree.
+ you can test option speeds using the
+ linkend="pgtestfsync"> module.
Note that this parameter is irrelevant if fsync
has been turned off.
- The directory contrib/tablefunc> in the source
- distribution contains more examples of set-returning functions.
+ The directory contrib/tablefunc>
+ module in the source distribution contains more examples of
+ set-returning functions.