The extension module defines two classes, Extension and ExtensionDict, derived from DbObject and DbObjectDict, respectively.


Extension is derived from DbObject and represents a Postgres extension.

class pyrseas.dbobject.extension.Extension(name, description, owner, schema, version=None, oid=None)

An extension

Extension.create(*args, **kwargs)

Return SQL statements to CREATE the extension

Returns:SQL statements
Extension.alter(inobj, no_owner=True)

Generate SQL to transform an existing extension

Parameters:inobj – a YAML map defining the new extension
Returns:list of SQL statements

This exists because ALTER EXTENSION does not permit altering the owner.

Extension Dictionary

ExtensionDict is derived from DbObjectDict. It is a dictionary that represents the collection of extensions in a database.

class pyrseas.dbobject.extension.ExtensionDict(dbconn=None)

The collection of extensions in a database

ExtensionDict.from_map(inexts, langtempls, newdb)

Initalize the dictionary of extensions by converting the input map

  • inexts – YAML map defining the extensions
  • langtempls – list of language templates
  • newdb – dictionary of input database