Database Reference
In-Depth Information
Installing an extension from PGXN
The PostgreSQL Extension Network provides a platform-independent tool to install
PostgreSQL extensions. This tool is written in Python, and uses the Python install-
ation system for distribution of itself. This is handy because the Python distribution
system exists virtually on every PostgreSQL supportable platform and makes it very
simple to get PostgreSQL extensions distributed to the community. The extension in-
staller works with a single set of instructions on all targets:
easy_install pgxnclient
Installing pgxncli.py script to /usr/local/bin
Installing pgxn script to /usr/local/bin
Processing dependencies for pgxnclient
Finished processing dependencies for pgxnclient
Now you have the tools installed to manage PostgreSQL extensions provided by the
PostgreSQL Extension Network.
Installing extensions is not really simple. For example, if we had a requirement to use
a new tinyint data type, we could add it with this command:
pgxn install tinyint
INFO: best version: tinyint 0.1.1
INFO: saving /tmp/tmpKvr0kM/tinyint-0.1.1.zip
INFO: unpacking: /tmp/tmpKvr0kM/tinyint-0.1.1.zip
INFO: building extension
...
The extension is now available in the shared extensions directory on your machine. To
activate it for any database, you would use the command that we started the chapter
with:
CREATE EXTENSION tinyint;
You will then see the confirmation text letting you know that tinyint has been ad-
ded:
Search WWH ::




Custom Search