Skip Navigation
Show nav
Heroku Dev Center Dev Center
  • Get Started
  • Documentation
  • Changelog
  • Search
Heroku Dev Center Dev Center
  • Get Started
    • Node.js
    • Ruby on Rails
    • Ruby
    • Python
    • Java
    • PHP
    • Go
    • Scala
    • Clojure
    • .NET
  • 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 in or Sign up
View categories

Categories

  • Heroku Architecture
    • Compute (Dynos)
      • Dyno Management
      • Dyno Concepts
      • Dyno Behavior
      • Dyno Reference
      • Dyno Troubleshooting
    • Stacks (operating system images)
    • Networking & DNS
    • Platform Policies
    • Platform Principles
    • Buildpacks
  • Developer Tools
    • AI Tools
    • Command Line
    • Heroku VS Code Extension
  • Deployment
    • Deploying with Git
    • Deploying with Docker
    • Deployment Integrations
  • Continuous Delivery & Integration (Heroku Flow)
    • Continuous Integration
  • Language Support
    • Node.js
      • Working with Node.js
      • Troubleshooting Node.js Apps
      • Node.js Behavior in Heroku
    • Ruby
      • Rails Support
        • Working with Rails
      • Working with Bundler
      • Working with Ruby
      • Ruby Behavior in Heroku
      • Troubleshooting Ruby Apps
    • Python
      • Working with Python
      • Background Jobs in Python
      • Python Behavior in Heroku
      • Working with Django
    • Java
      • Java Behavior in Heroku
      • Working with Java
      • Working with Maven
      • Working with Spring Boot
      • Troubleshooting Java Apps
    • PHP
      • Working with PHP
      • PHP Behavior in Heroku
    • Go
      • Go Dependency Management
    • Scala
    • Clojure
    • .NET
      • Working with .NET
  • Databases & Data Management
    • Heroku Postgres
      • Postgres Basics
      • Postgres Getting Started
      • Postgres Performance
      • Postgres Data Transfer & Preservation
      • Postgres Availability
      • Postgres Special Topics
      • Migrating to Heroku Postgres
    • Heroku Key-Value Store
    • Apache Kafka on Heroku
    • Other Data Stores
  • AI
    • Inference Essentials
    • Inference API
    • Inference Quick Start Guides
    • AI Models
    • Tool Use
    • AI Integrations
    • Vector Database
  • Monitoring & Metrics
    • Logging
  • App Performance
  • Add-ons
    • All Add-ons
  • Collaboration
  • Security
    • App Security
    • Identities & Authentication
      • Single Sign-on (SSO)
    • Private Spaces
      • Infrastructure Networking
    • Compliance
  • Heroku Enterprise
    • Enterprise Accounts
    • Enterprise Teams
  • 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
    • Heroku AppLink
      • Getting Started with Heroku AppLink
      • Working with Heroku AppLink
      • Heroku AppLink Reference
    • Heroku Connect (Salesforce sync)
      • Heroku Connect Administration
      • Heroku Connect Reference
      • Heroku Connect Troubleshooting
    • Other Salesforce Integrations
  • Databases & Data Management
  • Heroku Postgres
  • Postgres Basics
  • Heroku Postgres Over Plan Capacity

Heroku Postgres Over Plan Capacity

English — 日本語に切り替える

Table of Contents [expand]

  • Over Plan Capacity Statuses
  • Steps to Resolve
  • Use Log Entries to Track Plan Capacity

Last updated February 24, 2026

If your Heroku Postgres database exceeds your plan allotment for storage capacity, you receive a warning email with directions on how to fix the issue. In some cases, we set an enforcement date when access to your database is disabled until the add-on’s data size is back within plan limits. Take action by upgrading your database plan or deleting data to avoid restricted access.

Over Plan Capacity Statuses

To see the status and current data size of your Heroku Postgres database, run the heroku pg:info command. If your database is over capacity, under Status you see: Over Plan Capacity: Action Required or Over Plan Capacity: Access Restricted.

The Heroku Dashboard also shows the status and data storage utilization of your Heroku Postgres databases.

Action Required

Your database is over its plan capacity, and you must upgrade its plan or delete unnecessary data to bring your data size within plan limits before the enforcement date. You can find the enforcement date in your email or in your application logs.

Access Restricted

Your database is over plan capacity beyond the enforcement date and we restricted database access. Restricted access means:

  • You’re allowed a single database connection through a restricted database credential.
  • Your restricted credential only has READ, DELETE, and TRUNCATE database privileges.

To regain full access, you can upgrade your database plan or delete data by connecting to the database with the restricted credential.

If your database has been over capacity for more than 30 days, Heroku attempts to reduce your data usage by running VACUUM FULL on your database to remove dead rows and reclaim the disk space used by bloat.

Steps to Resolve

Check Your Data Usage

To check your Postgres database, use heroku pg:info. The output shows your database plan and data size so you can decide whether to upgrade your plan or remove data.

$ heroku pg:info HEROKU_POSTGRESQL_COBALT -a example-app
=== HEROKU_POSTGRESQL_COBALT_URL
Plan: Standard 0
Status: Over Capacity: Action Required
Data Size: 144.6 GB

The Heroku Dashboard also shows the data storage utilization and plan of your Heroku Postgres databases.

Upgrade Your Plan

To get more storage, you can upgrade your Heroku Postgres plan. If you do upgrade, you avoid data loss and minimize downtime. You can downgrade your database plan at any time if your data storage reduces.

The simplest way to upgrade is to use the addons:upgrade command, specifying your add-on and the target plan:

$ heroku addons:upgrade HEROKU_POSTGRESQL_COBALT_URL heroku-postgresql:standard-2 -a example-app

To learn about more upgrade tools, see Changing the Plan or Infrastructure of a Heroku Postgres Database..

Delete Your Data

When database access is restricted, you’re allowed a single database connection through a new, restricted database credential. If your Heroku dynos automatically attempt to connect to your database, they might consume the single connection slot available.To connect to your database, consider shutting down any dynos before directly connecting with the restricted credentials. Contact Heroku Support if you still can’t connect to your database.

To return within your plan limits, you can delete data instead of upgrading to a larger plan.

Test Deletion with a Fork

Before you delete data from your database, create a fork so that you can experiment before you act on your data.

After you create a fork, you can follow these steps to delete your data. These examples use pg:psql to modify the database directly with SQL queries.

Delete Data

To delete data, use a condition to remove specific rows from a table, or truncate a table to delete all its records.

$ heroku pg:psql HEROKU_POSTGRESQL_COBALT -a example-app
# Delete records older than 30 days
example-app::HEROKU_POSTGRESQL_COBALT=> DELETE FROM logs WHERE created_at < (now() - '30 days'::interval);

The restricted credential doesn’t have DROP privileges to delete tables. To remove all data from a table of noncritical data, you can use TRUNCATE:

heroku pg:psql HEROKU_POSTGRESQL_COBALT -a example-app
example-app::HEROKU_POSTGRESQL_COBALT=> TRUNCATE TABLE logs;
Re-Index

Re-index tables or specific indexes to reclaim space from bloated indexes after deleting or truncating data:

example-app::HEROKU_POSTGRESQL_COBALT=> REINDEX TABLE CONCURRENTLY logs;
Vacuum

Running VACUUM FULL on a table takes an AccessExclusive lock on the table and it blocks other queries from reading it while it runs.

Your Postgres plan is measured by disk usage. Postgres doesn’t perform deletes on disk, but marks space that can be reused. To release unused disk space, run VACUUM FULL. When you test this on your fork, note how long the VACUUM FULL takes so you can assess the production impact.

example-app::HEROKU_POSTGRESQL_COBALT=> VACUUM FULL;

See Managing VACUUM on Heroku Postgres for more info on types of VACUUM operations and how they work.

Performing Deletion on Your Live Database

Put your app in maintenance mode while you use VACUUM FULL so users can’t access it mid-operation. If your database access is restricted, it’s possible that your application is inoperable already as your application wouldn’t be able to open the necessary connections against your database, but use maintenance mode to be safe.

Use Log Entries to Track Plan Capacity

Heroku Postgres emits log messages to Logplex when your service goes over capacity. The log messages are available via the CLI or via logging add-ons.

Log entries follow the standard log format.

If your database is over capacity, Heroku Postgres emits a Pending Enforcement warning log line:

$ heroku logs -a example-app
2026-07-20T23:14:08.000000+00:00 app[heroku-postgres]: source=HEROKU_POSTGRESQL_GREEN_URL addon=postgresql-octagonal-423563 sample#restricted=false sample#database-capacity-used-bytes=107889578475 sample#database-capacity-used-percentage=157.00 sample#database-capacity-bytes=68719476736 sample#enforcement-date=2026-08-04 00:00:00 +0000 message=Pending Enforcement: Upgrade or delete data by 2026-08-04 00:00:00 +0000 or lose database access

If your enforcement date has passed, Heroku Postgres emits an Access Restricted warning log line:

$ heroku logs -a example-app
2026-08-28T23:14:08.000000+00:00 app[heroku-postgres]: source=HEROKU_POSTGRESQL_GREEN_URL addon=postgresql-octagonal-423563 sample#restricted=true sample#database-capacity-used-bytes=107889578475 sample#database-capacity-used-percentage=157.00 sample#database-capacity-bytes=68719476736 message=Access Restricted: Upgrade or delete data to restore access

Feedback

Log in to submit feedback.

Information & Support

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

Language Reference

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

Other Resources

  • Careers
  • Elements
  • Products
  • Pricing
  • RSS
    • Dev Center Articles
    • Dev Center Changelog
    • Heroku Blog
    • Heroku News Blog
    • Heroku Engineering Blog
  • Twitter
    • Dev Center Articles
    • Dev Center Changelog
    • Heroku
    • Heroku Status
  • Github
  • LinkedIn
  • © 2026 Salesforce, Inc. All rights reserved. Various trademarks held by their respective owners. Salesforce Tower, 415 Mission Street, 3rd Floor, San Francisco, CA 94105, United States
  • heroku.com
  • Legal
  • Terms of Service
  • Privacy Information
  • Responsible Disclosure
  • Trust
  • Contact
  • Cookie Preferences
  • Your Privacy Choices