Database Reference
In-Depth Information
Extensions
While using PostgreSQL, the user may feel the need to expand certain PostgreSQL
functionalities by including multiple SQL objects, like new operators, new index
operator classes, and new data types along with new functions. In PostgreSQL, all
these objects are collected into a single package called extension . When creating an
extension, a user will need to have the following iles:
• A SQL script ile, which must have some SQL commands for creating objects
• A control ile, which speciies a few basic properties of the extension
• If the extension includes C code, then there will be a C shared library ile
After getting all these iles in one place, the user can create the extension by
simply using the SQL command CREATE EXTENSION extension_name .
The CREATE EXTENSION command will load objects present in the extension
into the current database.
We will learn the following in the upcoming sections:
• What an extension is
• How to CREATE , ALTER , and DELETE an extension
• PostgreSQL supplied extensions
Features of an extension
There are many features of extensions and the most important feature is ease of
use . The user can simply load all objects in the database with the single CREATE
EXTENSION command and can drop all the objects with a single DROP EXTENSION
command. When the object is enclosed inside the extension, PostgreSQL will not
allow any user to drop an individual object contained in an extension; the only way
to achieve this goal is by dropping the whole extension.
Search WWH ::




Custom Search