Book Image

PostgreSQL Server Programming - Second Edition

Book Image

PostgreSQL Server Programming - Second Edition

Overview of this book

Table of Contents (21 chapters)
PostgreSQL Server Programming Second Edition
Credits
About the Authors
About the Reviewers
www.PacktPub.com
Preface
Index

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 = true
requires = '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 http://www.postgresql.org/docs/current/static/extend-extensions.html.

This example shows the 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 granted.

Multiple dependencies can be indicated by separating...