Cookbooks
postgresql
documentation
Postgresql Extension

postgresql_extension

Back to resource list

This resource manages PostgreSQL extensions for a given database

Uses

Actions

  • :create - Creates an extension in a given database
  • :drop - Drops an extension from the database
  • :delete - Alias for :drop

Properties

NameName?TypeDefaultDescriptionAllowed Values
extensionStringThe name of the extension to be installed
schemaStringThe name of the schema in which to install the extension objects
old_versionStringold_version must be specified when, and only when, you are attempting to install an extension that replaces an "old style" module that is just a collection of objects not packaged into an extension.
versionStringThe version of the extension to install
cascadetrue, falseAutomatically install any extensions that this extension depends on that are not already installed
restricttrue, falseThis option prevents the specified extensions from being dropped if other objects, besides these extensions, their members, and their explicitly dependent routines, depend on them

Libraries

  • PostgreSQL::Cookbook::SqlHelpers::Extension

Examples

To install the adminpack extension:

# Add the contrib package in Ubuntu/Debian
package 'postgresql-contrib15'
 
# Install adminpack extension
postgresql_extension 'postgres adminpack' do
  dbname 'postgres'
  extension 'adminpack'
end
Was this helpful?