F: Additional Supplied Modules and Extensions

Appendix F. Additional Supplied Modules and Extensions

Table of Contents

F.15. file_fdw — access data files in the server's file system

F.30. pg_stat_statements — track statistics of SQL planning and execution

F.33. pg_trgm — support for similarity of text using trigram matching

pg_hint_plan - tweak execution plans in SQL comments

Many components supply new user-defined functions, operators, or types, packaged as extensions. To make use of one of these extensions, 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 command. In a fresh database, you can simply do

CREATE EXTENSION extension_name;

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

Many extensions 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.