Module Manager

From PostgreSQL wiki

There has been some interest PostgreSQL extension/package/module manager.

We would like some software to make it easier for users and developers to install and manage
various add-on features available for PostgreSQL.

Currently the process of installing add-ons is rather manual and cumbersome.
It usually requires command-line interface and/or superuser access.
It would be great, if modules could be used through SQL alone.

Grant module usage privilege to user

Elaboration

Use Cases

Convincing ISPs that modules are cool and can be easily installed and used safely

Wishes/Requirements

✓ = done,
❤ = work in progress

✓ enable regular users to install modules

Done through use of SECURITY DEFINER functions.
Basically, module import/deport functions run as superuser and can do anything.
USAGE privilege on module manager schema must be granted to roles to enable them to use modules.

install modules by name (and optionally version)

❤ command line interface, in spirit of apt-get or CPAN

✓ transactional installation (module either gets installed ok or not at all)

✓ you should be able to tell what is installed

✓ should manage current contrib stuff too

support multiple versions of databases and extensions

auto-get and compile and install extensions from sources from internet

module sources: contrib, pgfoundry, user

dependencies management (install dependencies as well)

uninstall should use dependancies, not hand-written SQL scripts

support for/integration with pg_dump/pg_restore; should dump import() statements insted of objects

Construction

Current status

There is a prototype implementation of user level module manager in PL/PgSQL in form of SQL schema.
The name of the schema defaults to modules, but can be configured at module manager installation time.

There is a prototype implementation of command-line tool in Perl, which help with module creation.
This is not needed by normal SQL users.

Concepts

A module is a collection of SQL objects,
which can be created or dropped at once.

Module manager is a tool, which is specific to PostgreSQL,
not a specific operating system. It should handle all tasks
related to module management