Extensions

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

Extension

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(dbversion=None)

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, newdb)

Initialize the dictionary of extensions by converting the input map

Parameters:
  • inexts – YAML map defining the extensions
  • newdb – dictionary of input database