Database Reference
In-Depth Information
Unpackaged extensions
Starting with Version 9.1, PostgreSQL provides a convenient way to move from the
primordial ooze of unversioned contrib modules into the brave new world of exten-
sions. Basically, you provide an SQL file to show the relationship of the objects to the
extension. The contrib module's cube provides a good example of this in cube--
unpackaged--1.0.sql :
/* contrib/cube/cube--unpackaged--1.0.sql */
-- complain if script is sourced in psql, rather
than via CREATE EXTENSION
\echo Use "CREATE EXTENSION cube" to load this
file. \quit
ALTER EXTENSION cube ADD type cube;
ALTER EXTENSION cube ADD function
cube_in(cstring);
ALTER EXTENSION cube ADD function cube(double
precision[],double precision[]);
ALTER EXTENSION cube ADD function cube(double
precision[]);
...
The code that provides multidimensional cubes for PostgreSQL has been stable for
quite some time. It is unlikely that a new version will be created any time soon. The
only reason for this module to be converted into an extension is to allow for easy in-
stallation and removal.
You would then execute the command:
CREATE EXTENSION cube FROM unpackaged;
The unrelated items are now grouped together into the extension named cube . This
also makes it easier for the packaging maintainer on any platform to include your ex-
Search WWH ::




Custom Search