Database Reference
In-Depth Information
The .control file
Along with the extension installation script file, you must provide a .control file. The
.control file for our example postal.control looks like this:
# postal address processing extension
comment = 'utilities for postal processing'
default_version = '1.0'
module_pathname = '$libdir/postal'
relocatable = truerequires = plpgsql
The purpose of the .control file is to provide a description of your extension.
This metadata may include directory , default_version , comment , encoding ,
module_pathname , requires , superuser , relocatable , and schema .
The main PostgreSQL documentation for this file is located at ht-
tp://www.postgresql.org/docs/current/static/extend-extensions.html .
This example shows a requires configuration parameter. Our extension depends
on the procedural language PL/pgSQL. On most platforms, it is installed by default.
Unfortunately, it is not installed on all platforms, and nothing should be taken for gran-
ted.
Multiple dependencies can be indicated by separating them with commas. This is very
handy when constructing a set of services based on multiple extensions.
As we mentioned in the previous section, PostgreSQL does not provide any interpret-
ation of the version number of an extension. Versions can be names as well as num-
bers, so there is no way for PostgreSQL to interpret that postal--lamb.sql comes
before postal--sheep.sql . This design limitation poses a problem to the exten-
sion developer, in that there is no way to specify that your extension depends on a
specific version of another extension. I would love to see this configuration paramet-
er enhanced with a syntax like requires = postgis >= 1.3 , but alas, no such
construction exists at the moment.
Search WWH ::




Custom Search