## Appendix F. Additional Supplied Modules

**Table of Contents**

[F.1. adminpack](adminpack.html)[F.2. amcheck](amcheck.html)[F.2.1. Functions](amcheck.html#id-1.11.7.11.8)[F.2.2. Optional *`heapallindexed`* Verification](amcheck.html#id-1.11.7.11.9)[F.2.3. Using `amcheck` Effectively](amcheck.html#id-1.11.7.11.10)[F.2.4. Repairing Corruption](amcheck.html#id-1.11.7.11.11)[F.3. auth\_delay](auth-delay.html)[F.3.1. Configuration Parameters](auth-delay.html#id-1.11.7.12.5)[F.3.2. Author](auth-delay.html#id-1.11.7.12.6)[F.4. auto\_explain](auto-explain.html)[F.4.1. Configuration Parameters](auto-explain.html#id-1.11.7.13.5)[F.4.2. Example](auto-explain.html#id-1.11.7.13.6)[F.4.3. Author](auto-explain.html#id-1.11.7.13.7)[F.5. bloom](bloom.html)[F.5.1. Parameters](bloom.html#id-1.11.7.14.7)[F.5.2. Examples](bloom.html#id-1.11.7.14.8)[F.5.3. Operator Class Interface](bloom.html#id-1.11.7.14.9)[F.5.4. Limitations](bloom.html#id-1.11.7.14.10)[F.5.5. Authors](bloom.html#id-1.11.7.14.11)[F.6. btree\_gin](btree-gin.html)[F.6.1. Example Usage](btree-gin.html#id-1.11.7.15.6)[F.6.2. Authors](btree-gin.html#id-1.11.7.15.7)[F.7. btree\_gist](btree-gist.html)[F.7.1. Example Usage](btree-gist.html#id-1.11.7.16.8)[F.7.2. Authors](btree-gist.html#id-1.11.7.16.9)[F.8. citext](citext.html)[F.8.1. Rationale](citext.html#id-1.11.7.17.6)[F.8.2. How to Use It](citext.html#id-1.11.7.17.7)[F.8.3. String Comparison Behavior](citext.html#id-1.11.7.17.8)[F.8.4. Limitations](citext.html#id-1.11.7.17.9)[F.8.5. Author](citext.html#id-1.11.7.17.10)[F.9. cube](cube.html)[F.9.1. Syntax](cube.html#id-1.11.7.18.5)[F.9.2. Precision](cube.html#id-1.11.7.18.6)[F.9.3. Usage](cube.html#id-1.11.7.18.7)[F.9.4. Defaults](cube.html#id-1.11.7.18.8)[F.9.5. Notes](cube.html#id-1.11.7.18.9)[F.9.6. Credits](cube.html#id-1.11.7.18.10)[F.10. dblink](dblink.html)[dblink\_connect](contrib-dblink-connect.html) — opens a persistent connection to a remote database[dblink\_connect\_u](contrib-dblink-connect-u.html) — opens a persistent connection to a remote database, insecurely[dblink\_disconnect](contrib-dblink-disconnect.html) — closes a persistent connection to a remote database[dblink](contrib-dblink-function.html) — executes a query in a remote database[dblink\_exec](contrib-dblink-exec.html) — executes a command in a remote database[dblink\_open](contrib-dblink-open.html) — opens a cursor in a remote database[dblink\_fetch](contrib-dblink-fetch.html) — returns rows from an open cursor in a remote database[dblink\_close](contrib-dblink-close.html) — closes a cursor in a remote database[dblink\_get\_connections](contrib-dblink-get-connections.html) — returns the names of all open named dblink connections[dblink\_error\_message](contrib-dblink-error-message.html) — gets last error message on the named connection[dblink\_send\_query](contrib-dblink-send-query.html) — sends an async query to a remote database[dblink\_is\_busy](contrib-dblink-is-busy.html) — checks if connection is busy with an async query[dblink\_get\_notify](contrib-dblink-get-notify.html) — retrieve async notifications on a connection[dblink\_get\_result](contrib-dblink-get-result.html) — gets an async query result[dblink\_cancel\_query](contrib-dblink-cancel-query.html) — cancels any active query on the named connection[dblink\_get\_pkey](contrib-dblink-get-pkey.html) — returns the positions and field names of a relation's primary key fields [dblink\_build\_sql\_insert](contrib-dblink-build-sql-insert.html) — builds an INSERT statement using a local tuple, replacing the primary key field values with alternative supplied values [dblink\_build\_sql\_delete](contrib-dblink-build-sql-delete.html) — builds a DELETE statement using supplied values for primary key field values [dblink\_build\_sql\_update](contrib-dblink-build-sql-update.html) — builds an UPDATE statement using a local tuple, replacing the primary key field values with alternative supplied values [F.11. dict\_int](dict-int.html)[F.11.1. Configuration](dict-int.html#id-1.11.7.20.5)[F.11.2. Usage](dict-int.html#id-1.11.7.20.6)[F.12. dict\_xsyn](dict-xsyn.html)[F.12.1. Configuration](dict-xsyn.html#id-1.11.7.21.4)[F.12.2. Usage](dict-xsyn.html#id-1.11.7.21.5)[F.13. earthdistance](earthdistance.html)[F.13.1. Cube-Based Earth Distances](earthdistance.html#id-1.11.7.22.7)[F.13.2. Point-Based Earth Distances](earthdistance.html#id-1.11.7.22.8)[F.14. file\_fdw](file-fdw.html)[F.15. fuzzystrmatch](fuzzystrmatch.html)[F.15.1. Soundex](fuzzystrmatch.html#id-1.11.7.24.6)[F.15.2. Levenshtein](fuzzystrmatch.html#id-1.11.7.24.7)[F.15.3. Metaphone](fuzzystrmatch.html#id-1.11.7.24.8)[F.15.4. Double Metaphone](fuzzystrmatch.html#id-1.11.7.24.9)[F.16. hstore](hstore.html)[F.16.1. `hstore` External Representation](hstore.html#id-1.11.7.25.5)[F.16.2. `hstore` Operators and Functions](hstore.html#id-1.11.7.25.6)[F.16.3. Indexes](hstore.html#id-1.11.7.25.7)[F.16.4. Examples](hstore.html#id-1.11.7.25.8)[F.16.5. Statistics](hstore.html#id-1.11.7.25.9)[F.16.6. Compatibility](hstore.html#id-1.11.7.25.10)[F.16.7. Transforms](hstore.html#id-1.11.7.25.11)[F.16.8. Authors](hstore.html#id-1.11.7.25.12)[F.17. intagg](intagg.html)[F.17.1. Functions](intagg.html#id-1.11.7.26.4)[F.17.2. Sample Uses](intagg.html#id-1.11.7.26.5)[F.18. intarray](intarray.html)[F.18.1. `intarray` Functions and Operators](intarray.html#id-1.11.7.27.7)[F.18.2. Index Support](intarray.html#id-1.11.7.27.8)[F.18.3. Example](intarray.html#id-1.11.7.27.9)[F.18.4. Benchmark](intarray.html#id-1.11.7.27.10)[F.18.5. Authors](intarray.html#id-1.11.7.27.11)[F.19. isn](isn.html)[F.19.1. Data Types](isn.html#id-1.11.7.28.5)[F.19.2. Casts](isn.html#id-1.11.7.28.6)[F.19.3. Functions and Operators](isn.html#id-1.11.7.28.7)[F.19.4. Examples](isn.html#id-1.11.7.28.8)[F.19.5. Bibliography](isn.html#id-1.11.7.28.9)[F.19.6. Author](isn.html#id-1.11.7.28.10)[F.20. lo](lo.html)[F.20.1. Rationale](lo.html#id-1.11.7.29.5)[F.20.2. How to Use It](lo.html#id-1.11.7.29.6)[F.20.3. Limitations](lo.html#id-1.11.7.29.7)[F.20.4. Author](lo.html#id-1.11.7.29.8)[F.21. ltree](ltree.html)[F.21.1. Definitions](ltree.html#id-1.11.7.30.5)[F.21.2. Operators and Functions](ltree.html#id-1.11.7.30.6)[F.21.3. Indexes](ltree.html#id-1.11.7.30.7)[F.21.4. Example](ltree.html#id-1.11.7.30.8)[F.21.5. Transforms](ltree.html#id-1.11.7.30.9)[F.21.6. Authors](ltree.html#id-1.11.7.30.10)[F.22. old\_snapshot](oldsnapshot.html)[F.22.1. Functions](oldsnapshot.html#id-1.11.7.31.4)[F.23. pageinspect](pageinspect.html)[F.23.1. General Functions](pageinspect.html#id-1.11.7.32.4)[F.23.2. Heap Functions](pageinspect.html#id-1.11.7.32.5)[F.23.3. B-Tree Functions](pageinspect.html#id-1.11.7.32.6)[F.23.4. BRIN Functions](pageinspect.html#id-1.11.7.32.7)[F.23.5. GIN Functions](pageinspect.html#id-1.11.7.32.8)[F.23.6. GiST Functions](pageinspect.html#id-1.11.7.32.9)[F.23.7. Hash Functions](pageinspect.html#id-1.11.7.32.10)[F.24. passwordcheck](passwordcheck.html)[F.25. pg\_buffercache](pgbuffercache.html)[F.25.1. The `pg_buffercache` View](pgbuffercache.html#id-1.11.7.34.7)[F.25.2. Sample Output](pgbuffercache.html#id-1.11.7.34.8)[F.25.3. Authors](pgbuffercache.html#id-1.11.7.34.9)[F.26. pgcrypto](pgcrypto.html)[F.26.1. General Hashing Functions](pgcrypto.html#id-1.11.7.35.6)[F.26.2. Password Hashing Functions](pgcrypto.html#id-1.11.7.35.7)[F.26.3. PGP Encryption Functions](pgcrypto.html#id-1.11.7.35.8)[F.26.4. Raw Encryption Functions](pgcrypto.html#id-1.11.7.35.9)[F.26.5. Random-Data Functions](pgcrypto.html#id-1.11.7.35.10)[F.26.6. Notes](pgcrypto.html#id-1.11.7.35.11)[F.26.7. Author](pgcrypto.html#id-1.11.7.35.12)[F.27. pg\_freespacemap](pgfreespacemap.html)[F.27.1. Functions](pgfreespacemap.html#id-1.11.7.36.5)[F.27.2. Sample Output](pgfreespacemap.html#id-1.11.7.36.6)[F.27.3. Author](pgfreespacemap.html#id-1.11.7.36.7)[F.28. pg\_prewarm](pgprewarm.html)[F.28.1. Functions](pgprewarm.html#id-1.11.7.37.4)[F.28.2. Configuration Parameters](pgprewarm.html#id-1.11.7.37.5)[F.28.3. Author](pgprewarm.html#id-1.11.7.37.6)[F.29. pgrowlocks](pgrowlocks.html)[F.29.1. Overview](pgrowlocks.html#id-1.11.7.38.5)[F.29.2. Sample Output](pgrowlocks.html#id-1.11.7.38.6)[F.29.3. Author](pgrowlocks.html#id-1.11.7.38.7)[F.30. pg\_stat\_statements](pgstatstatements.html)[F.30.1. The `pg_stat_statements` View](pgstatstatements.html#id-1.11.7.39.6)[F.30.2. The `pg_stat_statements_info` View](pgstatstatements.html#id-1.11.7.39.7)[F.30.3. Functions](pgstatstatements.html#id-1.11.7.39.8)[F.30.4. Configuration Parameters](pgstatstatements.html#id-1.11.7.39.9)[F.30.5. Sample Output](pgstatstatements.html#id-1.11.7.39.10)[F.30.6. Authors](pgstatstatements.html#id-1.11.7.39.11)[F.31. pgstattuple](pgstattuple.html)[F.31.1. Functions](pgstattuple.html#id-1.11.7.40.5)[F.31.2. Authors](pgstattuple.html#id-1.11.7.40.6)[F.32. pg\_surgery](pgsurgery.html)[F.32.1. Functions](pgsurgery.html#id-1.11.7.41.4)[F.32.2. Authors](pgsurgery.html#id-1.11.7.41.5)[F.33. pg\_trgm](pgtrgm.html)[F.33.1. Trigram (or Trigraph) Concepts](pgtrgm.html#id-1.11.7.42.5)[F.33.2. Functions and Operators](pgtrgm.html#id-1.11.7.42.6)[F.33.3. GUC Parameters](pgtrgm.html#id-1.11.7.42.7)[F.33.4. Index Support](pgtrgm.html#id-1.11.7.42.8)[F.33.5. Text Search Integration](pgtrgm.html#id-1.11.7.42.9)[F.33.6. References](pgtrgm.html#id-1.11.7.42.10)[F.33.7. Authors](pgtrgm.html#id-1.11.7.42.11)[F.34. pg\_visibility](pgvisibility.html)[F.34.1. Functions](pgvisibility.html#id-1.11.7.43.6)[F.34.2. Author](pgvisibility.html#id-1.11.7.43.7)[F.35. postgres\_fdw](postgres-fdw.html)[F.35.1. FDW Options of postgres\_fdw](postgres-fdw.html#id-1.11.7.44.11)[F.35.2. Functions](postgres-fdw.html#id-1.11.7.44.12)[F.35.3. Connection Management](postgres-fdw.html#id-1.11.7.44.13)[F.35.4. Transaction Management](postgres-fdw.html#id-1.11.7.44.14)[F.35.5. Remote Query Optimization](postgres-fdw.html#id-1.11.7.44.15)[F.35.6. Remote Query Execution Environment](postgres-fdw.html#id-1.11.7.44.16)[F.35.7. Cross-Version Compatibility](postgres-fdw.html#id-1.11.7.44.17)[F.35.8. Examples](postgres-fdw.html#id-1.11.7.44.18)[F.35.9. Author](postgres-fdw.html#id-1.11.7.44.19)[F.36. seg](seg.html)[F.36.1. Rationale](seg.html#id-1.11.7.45.5)[F.36.2. Syntax](seg.html#id-1.11.7.45.6)[F.36.3. Precision](seg.html#id-1.11.7.45.7)[F.36.4. Usage](seg.html#id-1.11.7.45.8)[F.36.5. Notes](seg.html#id-1.11.7.45.9)[F.36.6. Credits](seg.html#id-1.11.7.45.10)[F.37. sepgsql](sepgsql.html)[F.37.1. Overview](sepgsql.html#SEPGSQL-OVERVIEW)[F.37.2. Installation](sepgsql.html#SEPGSQL-INSTALLATION)[F.37.3. Regression Tests](sepgsql.html#SEPGSQL-REGRESSION)[F.37.4. GUC Parameters](sepgsql.html#SEPGSQL-PARAMETERS)[F.37.5. Features](sepgsql.html#SEPGSQL-FEATURES)[F.37.6. Sepgsql Functions](sepgsql.html#SEPGSQL-FUNCTIONS)[F.37.7. Limitations](sepgsql.html#SEPGSQL-LIMITATIONS)[F.37.8. External Resources](sepgsql.html#SEPGSQL-RESOURCES)[F.37.9. Author](sepgsql.html#SEPGSQL-AUTHOR)[F.38. spi](contrib-spi.html)[F.38.1. refint — Functions for Implementing Referential Integrity](contrib-spi.html#id-1.11.7.47.5)[F.38.2. autoinc — Functions for Autoincrementing Fields](contrib-spi.html#id-1.11.7.47.6)[F.38.3. insert\_username — Functions for Tracking Who Changed a Table](contrib-spi.html#id-1.11.7.47.7)[F.38.4. moddatetime — Functions for Tracking Last Modification Time](contrib-spi.html#id-1.11.7.47.8)[F.39. sslinfo](sslinfo.html)[F.39.1. Functions Provided](sslinfo.html#id-1.11.7.48.6)[F.39.2. Author](sslinfo.html#id-1.11.7.48.7)[F.40. tablefunc](tablefunc.html)[F.40.1. Functions Provided](tablefunc.html#id-1.11.7.49.5)[F.40.2. Author](tablefunc.html#id-1.11.7.49.6)[F.41. tcn](tcn.html)[F.42. test\_decoding](test-decoding.html)[F.43. tsm\_system\_rows](tsm-system-rows.html)[F.43.1. Examples](tsm-system-rows.html#id-1.11.7.52.8)[F.44. tsm\_system\_time](tsm-system-time.html)[F.44.1. Examples](tsm-system-time.html#id-1.11.7.53.8)[F.45. unaccent](unaccent.html)[F.45.1. Configuration](unaccent.html#id-1.11.7.54.6)[F.45.2. Usage](unaccent.html#id-1.11.7.54.7)[F.45.3. Functions](unaccent.html#id-1.11.7.54.8)[F.46. uuid-ossp](uuid-ossp.html)[F.46.1. `uuid-ossp` Functions](uuid-ossp.html#id-1.11.7.55.5)[F.46.2. Building `uuid-ossp`](uuid-ossp.html#id-1.11.7.55.6)[F.46.3. Author](uuid-ossp.html#id-1.11.7.55.7)[F.47. xml2](xml2.html)[F.47.1. Deprecation Notice](xml2.html#id-1.11.7.56.4)[F.47.2. Description of Functions](xml2.html#id-1.11.7.56.5)[F.47.3. `xpath_table`](xml2.html#id-1.11.7.56.6)[F.47.4. XSLT Functions](xml2.html#id-1.11.7.56.7)[F.47.5. Author](xml2.html#id-1.11.7.56.8)

 This appendix and the next one contain information regarding the modules that can be found in the `contrib` directory of the PostgreSQL distribution. These include porting tools, analysis utilities, 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.

 This appendix covers extensions and other server plug-in modules found in `contrib`. [Appendix G](contrib-prog.html) covers utility programs.

 When building from the source distribution, these components are not built automatically, unless you build the "world" target (see [Step 2](install-procedure.html#BUILD)). You can build and install all of them by running:

```
make
make install

```

 in the `contrib` 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 running:

```
make check

```

 before installation or

```
make installcheck

```

 once you have a PostgreSQL server running.

 If you are using a pre-packaged version of PostgreSQL, these modules are typically made available as a separate subpackage, such as `postgresql-contrib`.

 Many modules supply new user-defined functions, operators, or types. To make use of one of these modules, after you have installed the code you need to register the new SQL objects in the database system. This is done by executing a [CREATE EXTENSION](sql-createextension.html) command. In a fresh database, you can simply do

```
CREATE EXTENSION module_name;

```

 This command registers the new SQL objects in the current database only, so you need to run it in each database that you want the module's facilities to be available in. Alternatively, run it in database `template1` so that the extension will be copied into subsequently-created databases by default.

 For all these modules, `CREATE EXTENSION` must be run by a database superuser, unless the module is considered “trusted”, in which case it can be run by any user who has `CREATE` 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.

 Many modules allow you to install their objects in a schema of your choice. To do that, add `SCHEMA *`schema_name`*` to the `CREATE EXTENSION` command. By default, the objects will be placed in your current creation target schema, which in turn defaults to `public`.

 Note, however, that some of these modules are not “extensions” in this sense, but are loaded into the server in some other way, for instance by way of [shared\_preload\_libraries](runtime-config-client.html#GUC-SHARED-PRELOAD-LIBRARIES). See the documentation of each module for details.

