Skip Navigation
Show nav
Heroku Dev Center
  • Get Started
  • Documentation
  • Changelog
  • Search
  • Get Started
    • Node.js
    • Ruby on Rails
    • Ruby
    • Python
    • Java
    • PHP
    • Go
    • Scala
    • Clojure
  • Documentation
  • Changelog
  • More
    Additional Resources
    • Home
    • Elements
    • Products
    • Pricing
    • Careers
    • Help
    • Status
    • Events
    • Podcasts
    • Compliance Center
    Heroku Blog

    Heroku Blog

    Find out what's new with Heroku on our blog.

    Visit Blog
  • Log inorSign up
View categories

Categories

  • Heroku Architecture
    • Dynos (app containers)
    • Stacks (operating system images)
    • Networking & DNS
    • Platform Policies
    • Platform Principles
  • Command Line
  • Deployment
    • Deploying with Git
    • Deploying with Docker
    • Deployment Integrations
  • Continuous Delivery
    • Continuous Integration
  • Language Support
    • Node.js
    • Ruby
      • Working with Bundler
      • Rails Support
    • Python
      • Working with Django
      • Background Jobs in Python
    • Java
      • Working with Maven
      • Java Database Operations
      • Working with Spring Boot
      • Java Advanced Topics
    • PHP
    • Go
      • Go Dependency Management
    • Scala
    • Clojure
  • Databases & Data Management
    • Heroku Postgres
      • Postgres Basics
      • Postgres Getting Started
      • Postgres Performance
      • Postgres Data Transfer & Preservation
      • Postgres Availability
      • Postgres Special Topics
    • Heroku Data For Redis
    • Apache Kafka on Heroku
    • Other Data Stores
  • Monitoring & Metrics
    • Logging
  • App Performance
  • Add-ons
    • All Add-ons
  • Collaboration
  • Security
    • App Security
    • Identities & Authentication
    • Compliance
  • Heroku Enterprise
    • Private Spaces
      • Infrastructure Networking
    • Enterprise Accounts
    • Enterprise Teams
    • Heroku Connect (Salesforce sync)
      • Heroku Connect Administration
      • Heroku Connect Reference
      • Heroku Connect Troubleshooting
    • Single Sign-on (SSO)
  • Patterns & Best Practices
  • Extending Heroku
    • Platform API
    • App Webhooks
    • Heroku Labs
    • Building Add-ons
      • Add-on Development Tasks
      • Add-on APIs
      • Add-on Guidelines & Requirements
    • Building CLI Plugins
    • Developing Buildpacks
    • Dev Center
  • Accounts & Billing
  • Troubleshooting & Support
  • Integrating with Salesforce
  • Extending Heroku
  • Heroku Labs
  • Heroku Data Labs: Extensions on Any Schema for Heroku Postgres

Heroku Data Labs: Extensions on Any Schema for Heroku Postgres

Last updated May 12, 2023

Table of Contents

  • Prerequisites
  • Enable Extensions on Any Schema on an Existing Heroku Postgres Database
  • Disable Extensions on Any Schema on an Existing Heroku Postgres Database
  • Show Feature Status
  • View Your Extensions

By default, Heroku Postgres extensions are installed to the heroku_ext schema. You can enable this Heroku Data Labs feature on existing databases to install PostgreSQL extensions on schemas other than heroku_ext.

You can install extensions on new non-Essential-tier databases at provision time. For Essentials-tier databases, you can only install extensions in the heroku_ext schema.

Features added through Heroku Data Labs are experimental and subject to change.

Prerequisites

  • A Standard, Premium, Private, or Shield tier Heroku Postgres database
  • The latest version of the Heroku Data CLI plugin installed

Enable Extensions on Any Schema on an Existing Heroku Postgres Database

To enable this feature, run the command:

$ heroku data:labs:enable extensions-on-any-schema --addon DATABASE_URL
  Enabling extensions-on-any-schema on postgresql-trapezoidal-57207...... done

This feature doesn’t modify any of your existing extensions and only applies to new extensions you install. Dropping an existing extension and recreating it installs the extension to the first schema in your search_path, typically public.

Disable Extensions on Any Schema on an Existing Heroku Postgres Database

To disable this feature, run the command:

$ heroku data:labs:disable extensions-on-any-schema --addon DATABASE_URL
  Disabling extensions-on-any-schema on postgresql-trapezoidal-57207...... done

Disabling this feature doesn’t change the schema on any existing extensions, and only forces new extensions to install to the heroku_ext schema.

Show Feature Status

To see if this feature is enabled or disabled, run the command:

$ heroku data:labs:list --addon DATABASE_URL
=== Experimental Features Available for YOUR_ADDON_NAME:
[+] Extensions on Any Schema        Enable extensions on any schema

A green cross within the box indicates that the feature is enabled on your add-on, while an empty box indicates that it’s disabled.

View Your Extensions

To see which schemas your extensions are installed in, open a session with heroku pg:psql and run the \dx command:

intense-mesa-15917::DATABASE=> \dx
                                           List of installed extensions
       Name        | Version |   Schema   |                              Description
--------------------+---------+------------+------------------------------------------------------------------------
pg_stat_statements | 1.10    | heroku_ext | track planning and execution statistics of all SQL statements executed
plpgsql            | 1.0     | pg_catalog | PL/pgSQL procedural language
xml2               | 1.1     | public     | XPath querying and XSLT
(3 rows)

Keep reading

  • Heroku Labs

Feedback

Log in to submit feedback.

Heroku Labs: log-runtime-metrics Heroku Data Labs: WAL Compression for Postgres Add-ons

Information & Support

  • Getting Started
  • Documentation
  • Changelog
  • Compliance Center
  • Training & Education
  • Blog
  • Podcasts
  • Support Channels
  • Status

Language Reference

  • Node.js
  • Ruby
  • Java
  • PHP
  • Python
  • Go
  • Scala
  • Clojure

Other Resources

  • Careers
  • Elements
  • Products
  • Pricing

Subscribe to our monthly newsletter

Your email address:

  • RSS
    • Dev Center Articles
    • Dev Center Changelog
    • Heroku Blog
    • Heroku News Blog
    • Heroku Engineering Blog
  • Heroku Podcasts
  • Twitter
    • Dev Center Articles
    • Dev Center Changelog
    • Heroku
    • Heroku Status
  • Facebook
  • Instagram
  • Github
  • LinkedIn
  • YouTube
Heroku is acompany
  • heroku.com
  • Terms of Service
  • Privacy
  • Cookies
  • Cookie Preferences
  • Your Privacy Choices
  • © 2023 Salesforce.com