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 extensions. Basically, you provide a 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 ...

Get PostgreSQL Server Programming - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.