manage postgresql databases
heroku pg [DATABASE]heroku pg:backupsheroku pg:backups:cancel [BACKUP_ID]heroku pg:backups:capture [DATABASE]heroku pg:backups:delete BACKUP_IDheroku pg:backups:download [BACKUP_ID]heroku pg:backups:info [BACKUP_ID]heroku pg:backups:restore [BACKUP] [DATABASE]heroku pg:backups:schedule [DATABASE]heroku pg:backups:schedulesheroku pg:backups:unschedule [DATABASE]heroku pg:backups:url [BACKUP_ID]heroku pg:bloat [DATABASE]heroku pg:blocking [DATABASE]heroku pg:connection-pooling:attach [DATABASE]heroku pg:copy SOURCE TARGETheroku pg:credentials [DATABASE]heroku pg:credentials:create [DATABASE]heroku pg:credentials:destroy [DATABASE]heroku pg:credentials:repair-default [DATABASE]heroku pg:credentials:rotate [DATABASE]heroku pg:credentials:url [DATABASE]heroku pg:diagnose [DATABASE|REPORT_ID]heroku pg:info [DATABASE]heroku pg:kill PID [DATABASE]heroku pg:killall [DATABASE]heroku pg:links [DATABASE]heroku pg:links:create REMOTE DATABASEheroku pg:links:destroy DATABASE LINKheroku pg:locks [DATABASE]heroku pg:outliers [DATABASE]heroku pg:promote DATABASEheroku pg:ps [DATABASE]heroku pg:psql [DATABASE]heroku pg:pull SOURCE TARGETheroku pg:push SOURCE TARGETheroku pg:reset [DATABASE]heroku pg:settings [DATABASE]heroku pg:settings:auto-explain [DATABASE] [VALUE]heroku pg:settings:auto-explain:log-analyze [DATABASE] [VALUE]heroku pg:settings:auto-explain:log-buffers [DATABASE] [VALUE]heroku pg:settings:auto-explain:log-format [DATABASE] [VALUE]heroku pg:settings:auto-explain:log-min-duration [DATABASE] [VALUE]heroku pg:settings:auto-explain:log-nested-statements [DATABASE] [VALUE]heroku pg:settings:auto-explain:log-triggers [DATABASE] [VALUE]heroku pg:settings:auto-explain:log-verbose [DATABASE] [VALUE]heroku pg:settings:data-connector-details-logs [DATABASE] [VALUE]heroku pg:settings:explain-data-connector-details [DATABASE] [VALUE]heroku pg:settings:log-connections [DATABASE] [VALUE]heroku pg:settings:log-lock-waits [DATABASE] [VALUE]heroku pg:settings:log-min-duration-statement [DATABASE] [VALUE]heroku pg:settings:log-min-error-statement [DATABASE] [VALUE]heroku pg:settings:log-statement [DATABASE] [VALUE]heroku pg:settings:track-functions [DATABASE] [VALUE]heroku pg:unfollow DATABASEheroku pg:upgrade:cancel [DATABASE]heroku pg:upgrade:dryrun [DATABASE]heroku pg:upgrade:prepare [DATABASE]heroku pg:upgrade:run [DATABASE]heroku pg:upgrade:wait [DATABASE]heroku pg:vacuum-stats [DATABASE]heroku pg:wait [DATABASE]
show database information
USAGE
$ heroku pg [DATABASE] -a <value> [--prompt] [-r <value>]
ARGUMENTS
[DATABASE] config var containing the connection string, unique name, ID, or alias of the database. To access another
app's database, prepend the app name to the config var or alias with `APP_NAME::` . If omitted, we use all
databases.
FLAGS
-a, --app=<value> (required) app to run command against
-r, --remote=<value> git remote of app to use
GLOBAL FLAGS
--prompt interactively prompt for command arguments and flags
DESCRIPTION
show database information
ALIASES
$ heroku pg
list database backups
USAGE
$ heroku pg:backups -a <value> [--prompt] [-r <value>]
FLAGS
-a, --app=<value> (required) app to run command against
-r, --remote=<value> git remote of app to use
GLOBAL FLAGS
--prompt interactively prompt for command arguments and flags
DESCRIPTION
list database backups
See code: src/commands/pg/backups/index.ts
cancel an in-progress backup or restore (default newest)
USAGE
$ heroku pg:backups:cancel [BACKUP_ID] -a <value> [--prompt] [-r <value>]
ARGUMENTS
[BACKUP_ID] ID of the backup. If omitted, we use the last unfinished backup ID.
FLAGS
-a, --app=<value> (required) app to run command against
-r, --remote=<value> git remote of app to use
GLOBAL FLAGS
--prompt interactively prompt for command arguments and flags
DESCRIPTION
cancel an in-progress backup or restore (default newest)
See code: src/commands/pg/backups/cancel.ts
capture a new backup
USAGE
$ heroku pg:backups:capture [DATABASE] -a <value> [--prompt] [-r <value>] [-v] [--wait-interval <value>]
ARGUMENTS
[DATABASE] config var containing the connection string, unique name, ID, or alias of the database. To access another
app's database, prepend the app name to the config var or alias with `APP_NAME::` . If omitted, we use
DATABASE_URL.
FLAGS
-a, --app=<value> (required) app to run command against
-r, --remote=<value> git remote of app to use
-v, --verbose
--wait-interval=<value>
GLOBAL FLAGS
--prompt interactively prompt for command arguments and flags
DESCRIPTION
capture a new backup
See code: src/commands/pg/backups/capture.ts
delete a backup
USAGE
$ heroku pg:backups:delete BACKUP_ID -a <value> [--prompt] [-r <value>]
ARGUMENTS
BACKUP_ID ID of the backup
FLAGS
-a, --app=<value> (required) app to run command against
-r, --remote=<value> git remote of app to use
GLOBAL FLAGS
--prompt interactively prompt for command arguments and flags
DESCRIPTION
delete a backup
EXAMPLES
$ heroku pg:backup:delete --app APP_ID BACKUP_ID
See code: src/commands/pg/backups/delete.ts
downloads database backup
USAGE
$ heroku pg:backups:download [BACKUP_ID] -a <value> [--prompt] [-o <value>] [-r <value>]
ARGUMENTS
[BACKUP_ID] ID of the backup. If omitted, we use the last backup ID.
FLAGS
-a, --app=<value> (required) app to run command against
-o, --output=<value> location to download to. Defaults to latest.dump
-r, --remote=<value> git remote of app to use
GLOBAL FLAGS
--prompt interactively prompt for command arguments and flags
DESCRIPTION
downloads database backup
See code: src/commands/pg/backups/download.ts
get information about a specific backup
USAGE
$ heroku pg:backups:info [BACKUP_ID] -a <value> [--prompt] [-r <value>]
ARGUMENTS
[BACKUP_ID] ID of the backup. If omitted, we use the last backup ID.
FLAGS
-a, --app=<value> (required) app to run command against
-r, --remote=<value> git remote of app to use
GLOBAL FLAGS
--prompt interactively prompt for command arguments and flags
DESCRIPTION
get information about a specific backup
See code: src/commands/pg/backups/info.ts
restore a backup (default latest) to a database
USAGE
$ heroku pg:backups:restore [BACKUP] [DATABASE] -a <value> [--prompt] [-c <value>] [-e <value>] [-r <value>] [-v]
[--wait-interval <value>]
ARGUMENTS
[BACKUP] URL or backup ID from another app
[DATABASE] config var containing the connection string, unique name, ID, or alias of the database. To access another
app's database, prepend the app name to the config var or alias with `APP_NAME::` . If omitted, we use
DATABASE_URL.
FLAGS
-a, --app=<value> (required) app to run command against
-c, --confirm=<value>
-e, --extensions=<value> comma-separated list of extensions to pre-install in the default
public schema or an optional custom schema
(for example: hstore or myschema.hstore)
-r, --remote=<value> git remote of app to use
-v, --verbose
--wait-interval=<value> [default: 3]
GLOBAL FLAGS
--prompt interactively prompt for command arguments and flags
DESCRIPTION
restore a backup (default latest) to a database
EXAMPLES
# Basic Restore from Backup ID
$ heroku pg:backups:restore b101 DATABASE_URL --app my-heroku-app
# Restore from Another App
$ heroku pg:backups:restore example-app::b101 DATABASE_URL --app my-heroku-app
# Restore from a Public URL
$ heroku pg:backups:restore "https://s3.amazonaws.com/my-bucket/mydb.dump" DATABASE_URL --app my-heroku-app
# Verbose Output
$ heroku pg:backups:restore b101 DATABASE_URL --app my-heroku-app --verbose
# Restore with Confirmation Prompt
$ heroku pg:backups:restore b101 DATABASE_URL --app my-heroku-app --confirm my-heroku-app
# Restore with a Specific Database Name
$ heroku pg:backups:restore b101 HEROKU_POSTGRESQL_PINK --app my-heroku-app
See code: src/commands/pg/backups/restore.ts
schedule daily backups for given database
USAGE
$ heroku pg:backups:schedule [DATABASE] -a <value> --at <value> [--prompt] [-r <value>]
ARGUMENTS
[DATABASE] config var containing the connection string, unique name, ID, or alias of the database. To access another
app's database, prepend the app name to the config var or alias with `APP_NAME::` . If omitted, we use
DATABASE_URL.
FLAGS
-a, --app=<value> (required) app to run command against
-r, --remote=<value> git remote of app to use
--at=<value> (required) at a specific (24h) hour in the given timezone. Defaults to UTC. --at '[HOUR]:00
[TIMEZONE]'
GLOBAL FLAGS
--prompt interactively prompt for command arguments and flags
DESCRIPTION
schedule daily backups for given database
See code: src/commands/pg/backups/schedule.ts
list backup schedule
USAGE
$ heroku pg:backups:schedules -a <value> [--prompt] [-r <value>]
FLAGS
-a, --app=<value> (required) app to run command against
-r, --remote=<value> git remote of app to use
GLOBAL FLAGS
--prompt interactively prompt for command arguments and flags
DESCRIPTION
list backup schedule
See code: src/commands/pg/backups/schedules.ts
stop daily backups
USAGE
$ heroku pg:backups:unschedule [DATABASE] -a <value> [--prompt] [-r <value>]
ARGUMENTS
[DATABASE] config var containing the connection string, unique name, ID, or alias of the database. To access another
app's database, prepend the app name to the config var or alias with `APP_NAME::` . If omitted, we use a
random database attached to the app.
FLAGS
-a, --app=<value> (required) app to run command against
-r, --remote=<value> git remote of app to use
GLOBAL FLAGS
--prompt interactively prompt for command arguments and flags
DESCRIPTION
stop daily backups
See code: src/commands/pg/backups/unschedule.ts
get secret but publicly accessible URL of a backup
USAGE
$ heroku pg:backups:url [BACKUP_ID] -a <value> [--prompt] [-r <value>]
ARGUMENTS
[BACKUP_ID] ID of the backup. If omitted, we use the last backup ID.
FLAGS
-a, --app=<value> (required) app to run command against
-r, --remote=<value> git remote of app to use
GLOBAL FLAGS
--prompt interactively prompt for command arguments and flags
DESCRIPTION
get secret but publicly accessible URL of a backup
See code: src/commands/pg/backups/url.ts
show table and index bloat in your database ordered by most wasteful
USAGE
$ heroku pg:bloat [DATABASE] -a <value> [--prompt] [-r <value>]
ARGUMENTS
[DATABASE] config var containing the connection string, unique name, ID, or alias of the database. To access another
app's database, prepend the app name to the config var or alias with `APP_NAME::` . If omitted, we use
DATABASE_URL.
FLAGS
-a, --app=<value> (required) app to run command against
-r, --remote=<value> git remote of app to use
GLOBAL FLAGS
--prompt interactively prompt for command arguments and flags
DESCRIPTION
show table and index bloat in your database ordered by most wasteful
See code: src/commands/pg/bloat.ts
display queries holding locks other queries are waiting to be released
USAGE
$ heroku pg:blocking [DATABASE] -a <value> [--prompt] [-r <value>]
ARGUMENTS
[DATABASE] config var containing the connection string, unique name, ID, or alias of the database. To access another
app's database, prepend the app name to the config var or alias with `APP_NAME::` . If omitted, we use
DATABASE_URL.
FLAGS
-a, --app=<value> (required) app to run command against
-r, --remote=<value> git remote of app to use
GLOBAL FLAGS
--prompt interactively prompt for command arguments and flags
DESCRIPTION
display queries holding locks other queries are waiting to be released
See code: src/commands/pg/blocking.ts
add an attachment to a database using connection pooling
USAGE
$ heroku pg:connection-pooling:attach [DATABASE] -a <value> [--prompt] [--as <value>] [-r <value>]
ARGUMENTS
[DATABASE] config var containing the connection string, unique name, ID, or alias of the database. To access another
app's database, prepend the app name to the config var or alias with `APP_NAME::` . If omitted, we use
DATABASE_URL.
FLAGS
-a, --app=<value> (required) app to run command against
-r, --remote=<value> git remote of app to use
--as=<value> name for add-on attachment
GLOBAL FLAGS
--prompt interactively prompt for command arguments and flags
DESCRIPTION
add an attachment to a database using connection pooling
EXAMPLES
$ heroku pg:connection-pooling:attach postgresql-something-12345
See code: src/commands/pg/connection-pooling/attach.ts
copy all data from source db to target
USAGE
$ heroku pg:copy SOURCE TARGET -a <value> [--prompt] [--confirm <value>] [-r <value>] [--verbose]
[--wait-interval <value>]
ARGUMENTS
SOURCE config var exposed to the owning app containing the source database URL
TARGET config var exposed to the owning app containing the target database URL
FLAGS
-a, --app=<value> (required) app to run command against
-r, --remote=<value> git remote of app to use
--confirm=<value>
--verbose
--wait-interval=<value>
GLOBAL FLAGS
--prompt interactively prompt for command arguments and flags
DESCRIPTION
copy all data from source db to target
See code: src/commands/pg/copy.ts
show information on credentials in the database
USAGE
$ heroku pg:credentials [DATABASE] -a <value> [--prompt] [--no-wrap] [-r <value>]
ARGUMENTS
[DATABASE] config var containing the connection string, unique name, ID, or alias of the database. To access another
app's database, prepend the app name to the config var or alias with `APP_NAME::` . If omitted, we use
DATABASE_URL.
FLAGS
-a, --app=<value> (required) app to run command against
-r, --remote=<value> git remote of app to use
--no-wrap disable wrapped table cells for easier copy/paste
GLOBAL FLAGS
--prompt interactively prompt for command arguments and flags
DESCRIPTION
show information on credentials in the database
See code: src/commands/pg/credentials.ts
create credential within database
USAGE
$ heroku pg:credentials:create [DATABASE] -a <value> -n <value> [--prompt] [-r <value>]
ARGUMENTS
[DATABASE] config var containing the connection string, unique name, ID, or alias of the database. To access another
app's database, prepend the app name to the config var or alias with `APP_NAME::` . If omitted, we use
DATABASE_URL.
FLAGS
-a, --app=<value> (required) app to run command against
-n, --name=<value> (required) name of the new credential within the database
-r, --remote=<value> git remote of app to use
GLOBAL FLAGS
--prompt interactively prompt for command arguments and flags
DESCRIPTION
create credential within database
EXAMPLES
$ heroku pg:credentials:create postgresql-something-12345 --name new-cred-name
See code: src/commands/pg/credentials/create.ts
destroy credential within database
USAGE
$ heroku pg:credentials:destroy [DATABASE] -a <value> -n <value> [--prompt] [-c <value>] [-r <value>]
ARGUMENTS
[DATABASE] config var containing the connection string, unique name, ID, or alias of the database. To access another
app's database, prepend the app name to the config var or alias with `APP_NAME::` . If omitted, we use
DATABASE_URL.
FLAGS
-a, --app=<value> (required) app to run command against
-c, --confirm=<value> set to app name to bypass confirm prompt
-n, --name=<value> (required) unique identifier for the credential
-r, --remote=<value> git remote of app to use
GLOBAL FLAGS
--prompt interactively prompt for command arguments and flags
DESCRIPTION
destroy credential within database
EXAMPLES
$ heroku pg:credentials:destroy postgresql-transparent-56874 --name cred-name -a woodstock-production
See code: src/commands/pg/credentials/destroy.ts
repair the permissions of the default credential within database
USAGE
$ heroku pg:credentials:repair-default [DATABASE] -a <value> [--prompt] [-c <value>] [-r <value>]
ARGUMENTS
[DATABASE] config var containing the connection string, unique name, ID, or alias of the database. To access another
app's database, prepend the app name to the config var or alias with `APP_NAME::` . If omitted, we use
DATABASE_URL.
FLAGS
-a, --app=<value> (required) app to run command against
-c, --confirm=<value> set to app name to bypass confirm prompt
-r, --remote=<value> git remote of app to use
GLOBAL FLAGS
--prompt interactively prompt for command arguments and flags
DESCRIPTION
repair the permissions of the default credential within database
EXAMPLES
$ heroku pg:credentials:repair-default postgresql-something-12345
See code: src/commands/pg/credentials/repair-default.ts
rotate the database credentials
USAGE
$ heroku pg:credentials:rotate [DATABASE] -a <value> [--prompt] [--all | -n <value>] [-c <value>] [--force] [-r
<value>]
ARGUMENTS
[DATABASE] config var containing the connection string, unique name, ID, or alias of the database. To access another
app's database, prepend the app name to the config var or alias with `APP_NAME::` . If omitted, we use
DATABASE_URL.
FLAGS
-a, --app=<value> (required) app to run command against
-c, --confirm=<value> set to app name to bypass confirm prompt
-n, --name=<value> which credential to rotate (default credentials if not specified and --all is not used)
-r, --remote=<value> git remote of app to use
--all rotate all credentials
--force forces rotating the targeted credentials
GLOBAL FLAGS
--prompt interactively prompt for command arguments and flags
DESCRIPTION
rotate the database credentials
See code: src/commands/pg/credentials/rotate.ts
show information on a database credential
USAGE
$ heroku pg:credentials:url [DATABASE] -a <value> [--prompt] [-n <value>] [-r <value>]
ARGUMENTS
[DATABASE] config var containing the connection string, unique name, ID, or alias of the database. To access another
app's database, prepend the app name to the config var or alias with `APP_NAME::` . If omitted, we use
DATABASE_URL.
FLAGS
-a, --app=<value> (required) app to run command against
-n, --name=<value> [default: default] which credential to show (default credentials if not specified)
-r, --remote=<value> git remote of app to use
GLOBAL FLAGS
--prompt interactively prompt for command arguments and flags
DESCRIPTION
show information on a database credential
See code: src/commands/pg/credentials/url.ts
run or view diagnostics report
USAGE
$ heroku pg:diagnose [DATABASE|REPORT_ID] -a <value> [--prompt] [--json] [-r <value>]
ARGUMENTS
[DATABASE|REPORT_ID] config var exposed to the owning app containing the database URL or the report ID
FLAGS
-a, --app=<value> (required) app to run command against
-r, --remote=<value> git remote of app to use
--json format output as JSON
GLOBAL FLAGS
--prompt interactively prompt for command arguments and flags
DESCRIPTION
run or view diagnostics report
defaults to DATABASE_URL database if no DATABASE is specified
if REPORT_ID is specified instead, a previous report is displayed
See code: src/commands/pg/diagnose.ts
show database information
USAGE
$ heroku pg:info [DATABASE] -a <value> [--prompt] [-r <value>]
ARGUMENTS
[DATABASE] config var containing the connection string, unique name, ID, or alias of the database. To access another
app's database, prepend the app name to the config var or alias with `APP_NAME::` . If omitted, we use all
databases.
FLAGS
-a, --app=<value> (required) app to run command against
-r, --remote=<value> git remote of app to use
GLOBAL FLAGS
--prompt interactively prompt for command arguments and flags
DESCRIPTION
show database information
ALIASES
$ heroku pg
See code: src/commands/pg/info.ts
kill a query
USAGE
$ heroku pg:kill PID [DATABASE] -a <value> [--prompt] [-f] [-r <value>]
ARGUMENTS
PID ID of the process
[DATABASE] config var containing the connection string, unique name, ID, or alias of the database. To access another
app's database, prepend the app name to the config var or alias with `APP_NAME::` . If omitted, we use
DATABASE_URL.
FLAGS
-a, --app=<value> (required) app to run command against
-f, --force
-r, --remote=<value> git remote of app to use
GLOBAL FLAGS
--prompt interactively prompt for command arguments and flags
DESCRIPTION
kill a query
See code: src/commands/pg/kill.ts
terminates all connections for all credentials
USAGE
$ heroku pg:killall [DATABASE] -a <value> [--prompt] [-r <value>]
ARGUMENTS
[DATABASE] config var containing the connection string, unique name, ID, or alias of the database. To access another
app's database, prepend the app name to the config var or alias with `APP_NAME::` . If omitted, we use
DATABASE_URL.
FLAGS
-a, --app=<value> (required) app to run command against
-r, --remote=<value> git remote of app to use
GLOBAL FLAGS
--prompt interactively prompt for command arguments and flags
DESCRIPTION
terminates all connections for all credentials
See code: src/commands/pg/killall.ts
lists all databases and information on link
USAGE
$ heroku pg:links [DATABASE] -a <value> [--prompt] [-r <value>]
ARGUMENTS
[DATABASE] config var containing the connection string, unique name, ID, or alias of the database. To access another
app's database, prepend the app name to the config var or alias with `APP_NAME::` . If omitted, we use
DATABASE_URL.
FLAGS
-a, --app=<value> (required) app to run command against
-r, --remote=<value> git remote of app to use
GLOBAL FLAGS
--prompt interactively prompt for command arguments and flags
DESCRIPTION
lists all databases and information on link
See code: src/commands/pg/links/index.ts
create a link between data stores
USAGE
$ heroku pg:links:create REMOTE DATABASE -a <value> [--prompt] [--as <value>] [-r <value>]
ARGUMENTS
REMOTE config var containing the connection string, unique name, ID, or alias of the database. To access another
app's database, prepend the app name to the config var or alias with `APP_NAME::`
DATABASE config var containing the connection string, unique name, ID, or alias of the database. To access another
app's database, prepend the app name to the config var or alias with `APP_NAME::`
FLAGS
-a, --app=<value> (required) app to run command against
-r, --remote=<value> git remote of app to use
--as=<value> name of link to create
GLOBAL FLAGS
--prompt interactively prompt for command arguments and flags
DESCRIPTION
create a link between data stores
EXAMPLES
$ heroku pg:links:create HEROKU_REDIS_RED HEROKU_POSTGRESQL_CERULEAN
See code: src/commands/pg/links/create.ts
destroys a link between data stores
USAGE
$ heroku pg:links:destroy DATABASE LINK -a <value> [--prompt] [-c <value>] [-r <value>]
ARGUMENTS
DATABASE config var containing the connection string, unique name, ID, or alias of the database. To access another
app's database, prepend the app name to the config var or alias with `APP_NAME::`
LINK name of the linked data store
FLAGS
-a, --app=<value> (required) app to run command against
-c, --confirm=<value>
-r, --remote=<value> git remote of app to use
GLOBAL FLAGS
--prompt interactively prompt for command arguments and flags
DESCRIPTION
destroys a link between data stores
EXAMPLES
$ heroku pg:links:destroy HEROKU_POSTGRESQL_CERULEAN redis-symmetrical-100
See code: src/commands/pg/links/destroy.ts
display queries with active locks
USAGE
$ heroku pg:locks [DATABASE] -a <value> [--prompt] [-t] [-r <value>]
ARGUMENTS
[DATABASE] config var containing the connection string, unique name, ID, or alias of the database. To access another
app's database, prepend the app name to the config var or alias with `APP_NAME::` . If omitted, we use
DATABASE_URL.
FLAGS
-a, --app=<value> (required) app to run command against
-r, --remote=<value> git remote of app to use
-t, --truncate truncates queries to 40 characters
GLOBAL FLAGS
--prompt interactively prompt for command arguments and flags
DESCRIPTION
display queries with active locks
See code: src/commands/pg/locks.ts
show 10 queries that have longest execution time in aggregate
USAGE
$ heroku pg:outliers [DATABASE] -a <value> [--prompt] [--reset] [-t] [-n <value>] [-r <value>]
ARGUMENTS
[DATABASE] config var containing the connection string, unique name, ID, or alias of the database. To access another
app's database, prepend the app name to the config var or alias with `APP_NAME::` . If omitted, we use
DATABASE_URL.
FLAGS
-a, --app=<value> (required) app to run command against
-n, --num=<value> the number of queries to display (default: 10)
-r, --remote=<value> git remote of app to use
-t, --truncate truncate queries to 40 characters
--reset resets statistics gathered by pg_stat_statements
GLOBAL FLAGS
--prompt interactively prompt for command arguments and flags
DESCRIPTION
show 10 queries that have longest execution time in aggregate
See code: src/commands/pg/outliers.ts
sets DATABASE as your DATABASE_URL
USAGE
$ heroku pg:promote DATABASE -a <value> [--prompt] [-f] [-r <value>]
ARGUMENTS
DATABASE config var containing the connection string, unique name, ID, or alias of the database. To access another
app's database, prepend the app name to the config var or alias with `APP_NAME::`
FLAGS
-a, --app=<value> (required) app to run command against
-f, --force
-r, --remote=<value> git remote of app to use
GLOBAL FLAGS
--prompt interactively prompt for command arguments and flags
DESCRIPTION
sets DATABASE as your DATABASE_URL
See code: src/commands/pg/promote.ts
view active queries with execution time
USAGE
$ heroku pg:ps [DATABASE] -a <value> [--prompt] [-v] [-r <value>]
ARGUMENTS
[DATABASE] config var containing the connection string, unique name, ID, or alias of the database. To access another
app's database, prepend the app name to the config var or alias with `APP_NAME::` . If omitted, we use
DATABASE_URL.
FLAGS
-a, --app=<value> (required) app to run command against
-r, --remote=<value> git remote of app to use
-v, --verbose
GLOBAL FLAGS
--prompt interactively prompt for command arguments and flags
DESCRIPTION
view active queries with execution time
See code: src/commands/pg/ps.ts
open a psql shell to the database
USAGE
$ heroku pg:psql [DATABASE] -a <value> [--prompt] [-c <value>] [-f <value>] [--credential <value>] [-r
<value>]
ARGUMENTS
[DATABASE] config var containing the connection string, unique name, ID, or alias of the database. To access another
app's database, prepend the app name to the config var or alias with `APP_NAME::` . If omitted, we use
DATABASE_URL.
FLAGS
-a, --app=<value> (required) app to run command against
-c, --command=<value> SQL command to run
-f, --file=<value> SQL file to run
-r, --remote=<value> git remote of app to use
--credential=<value> credential to use
GLOBAL FLAGS
--prompt interactively prompt for command arguments and flags
DESCRIPTION
open a psql shell to the database
ALIASES
$ heroku psql
See code: src/commands/pg/psql.ts
pull Heroku database into local or remote database
USAGE
$ heroku pg:pull SOURCE TARGET -a <value> [--prompt] [--exclude-table-data <value>] [-r <value>]
ARGUMENTS
SOURCE config var containing the connection string, unique name, ID, or alias of the database. To access another
app's database, prepend the app name to the config var or alias with `APP_NAME::` . If omitted, we use
DATABASE_URL.
TARGET PostgreSQL connection string for the target database
FLAGS
-a, --app=<value> (required) app to run command against
-r, --remote=<value> git remote of app to use
--exclude-table-data=<value> tables for which data should be excluded (use ';' to split multiple names)
GLOBAL FLAGS
--prompt interactively prompt for command arguments and flags
DESCRIPTION
pull Heroku database into local or remote database
Pull from SOURCE into TARGET.
TARGET must be one of:
* a database name (i.e. on a local PostgreSQL server) => TARGET must not exist and will be created
* a fully qualified URL to a local PostgreSQL server => TARGET must not exist and will be created
* a fully qualified URL to a remote PostgreSQL server => TARGET must exist and be empty
To delete a local database run dropdb TARGET.
To create an empty remote database, run createdb with connection command-line options (run createdb --help for
details).
EXAMPLES
# pull Heroku DB named postgresql-swimmingly-100 into local DB mylocaldb that must not exist
$ heroku pg:pull postgresql-swimmingly-100 mylocaldb --app sushi
# pull Heroku DB named postgresql-swimmingly-100 into empty remote DB at postgres://myhost/mydb
$ heroku pg:pull postgresql-swimmingly-100 postgres://myhost/mydb --app sushi
See code: src/commands/pg/pull.ts
push local or remote into Heroku database
USAGE
$ heroku pg:push SOURCE TARGET -a <value> [--prompt] [--exclude-table-data <value>] [-r <value>]
ARGUMENTS
SOURCE PostgreSQL connection string for the source database
TARGET config var containing the connection string, unique name, ID, or alias of the database. To access another
app's database, prepend the app name to the config var or alias with `APP_NAME::` . If omitted, we use
DATABASE_URL.
FLAGS
-a, --app=<value> (required) app to run command against
-r, --remote=<value> git remote of app to use
--exclude-table-data=<value> tables for which data should be excluded (use ';' to split multiple names)
GLOBAL FLAGS
--prompt interactively prompt for command arguments and flags
DESCRIPTION
push local or remote into Heroku database
Push from SOURCE into TARGET. TARGET must be empty.
To empty a Heroku database for push run heroku pg:reset
SOURCE must be either the name of a database existing on your localhost or the
fully qualified URL of a remote database.
EXAMPLES
# push mylocaldb into a Heroku DB named postgresql-swimmingly-100
$ heroku pg:push mylocaldb postgresql-swimmingly-100 --app sushi
# push remote DB at postgres://myhost/mydb into a Heroku DB named postgresql-swimmingly-100
$ heroku pg:push postgres://myhost/mydb postgresql-swimmingly-100 --app sushi
See code: src/commands/pg/push.ts
delete all data in DATABASE
USAGE
$ heroku pg:reset [DATABASE] -a <value> [--prompt] [-c <value>] [-e <value>] [-r <value>]
ARGUMENTS
[DATABASE] config var containing the connection string, unique name, ID, or alias of the database. To access another
app's database, prepend the app name to the config var or alias with `APP_NAME::` . If omitted, we use
DATABASE_URL.
FLAGS
-a, --app=<value> (required) app to run command against
-c, --confirm=<value>
-e, --extensions=<value> comma-separated list of extensions to pre-install in the public schema
-r, --remote=<value> git remote of app to use
GLOBAL FLAGS
--prompt interactively prompt for command arguments and flags
DESCRIPTION
delete all data in DATABASE
See code: src/commands/pg/reset.ts
show your current database settings
USAGE
$ heroku pg:settings [DATABASE] -a <value> [--prompt] [-r <value>]
ARGUMENTS
[DATABASE] config var containing the connection string, unique name, ID, or alias of the database. To access another
app's database, prepend the app name to the config var or alias with `APP_NAME::` . If omitted, we use
DATABASE_URL.
FLAGS
-a, --app=<value> (required) app to run command against
-r, --remote=<value> git remote of app to use
GLOBAL FLAGS
--prompt interactively prompt for command arguments and flags
DESCRIPTION
show your current database settings
See code: src/commands/pg/settings/index.ts
Automatically log execution plans of queries without running EXPLAIN by hand.
USAGE
$ heroku pg:settings:auto-explain [DATABASE...] [VALUE...] -a <value> [--prompt] [-r <value>]
ARGUMENTS
[DATABASE...] config var containing the connection string, unique name, ID, or alias of the database. To access
another app's database, prepend the app name to the config var or alias with `APP_NAME::` . If omitted,
we use DATABASE_URL.
[VALUE...] boolean indicating if execution plans of queries will be logged for future connections
FLAGS
-a, --app=<value> (required) app to run command against
-r, --remote=<value> git remote of app to use
GLOBAL FLAGS
--prompt interactively prompt for command arguments and flags
DESCRIPTION
Automatically log execution plans of queries without running EXPLAIN by hand.
The auto_explain module is loaded at session-time so existing connections will not be logged.
Restart your Heroku app and/or restart existing connections for logging to start taking place.
See code: src/commands/pg/settings/auto-explain.ts
Shows actual run times on the execution plan.
USAGE
$ heroku pg:settings:auto-explain:log-analyze [DATABASE] [VALUE] -a <value> [--prompt] [-r <value>]
ARGUMENTS
[DATABASE] config var containing the connection string, unique name, ID, or alias of the database. To access another
app's database, prepend the app name to the config var or alias with `APP_NAME::` . If omitted, we use
DATABASE_URL.
[VALUE] boolean indicating if execution plans get logged
FLAGS
-a, --app=<value> (required) app to run command against
-r, --remote=<value> git remote of app to use
GLOBAL FLAGS
--prompt interactively prompt for command arguments and flags
DESCRIPTION
Shows actual run times on the execution plan.
This is equivalent to calling EXPLAIN ANALYZE.
WARNING: EXPLAIN ANALYZE will be run on ALL queries, not just logged queries. This can cause significant performance
impacts to your database and should be used with caution.
See code: src/commands/pg/settings/auto-explain/log-analyze.ts
Includes buffer usage statistics when execution plans are logged.
USAGE
$ heroku pg:settings:auto-explain:log-buffers [DATABASE] [VALUE] -a <value> [--prompt] [-r <value>]
ARGUMENTS
[DATABASE] config var containing the connection string, unique name, ID, or alias of the database. To access another
app's database, prepend the app name to the config var or alias with `APP_NAME::` . If omitted, we use
DATABASE_URL.
[VALUE] boolean indicating if the database has buffer statistics enabled
FLAGS
-a, --app=<value> (required) app to run command against
-r, --remote=<value> git remote of app to use
GLOBAL FLAGS
--prompt interactively prompt for command arguments and flags
DESCRIPTION
Includes buffer usage statistics when execution plans are logged.
This is equivalent to calling EXPLAIN BUFFERS and can only be used in conjunction with
pg:settings:auto-explain:log-analyze turned on.
See code: src/commands/pg/settings/auto-explain/log-buffers.ts
selects the EXPLAIN output format to be used
USAGE
$ heroku pg:settings:auto-explain:log-format [DATABASE] [VALUE] -a <value> [--prompt] [-r <value>]
ARGUMENTS
[DATABASE] config var containing the connection string, unique name, ID, or alias of the database. To access another
app's database, prepend the app name to the config var or alias with `APP_NAME::` . If omitted, we use
DATABASE_URL.
[VALUE] (text|json|yaml|xml) format of the log output
<options: text|json|yaml|xml>
FLAGS
-a, --app=<value> (required) app to run command against
-r, --remote=<value> git remote of app to use
GLOBAL FLAGS
--prompt interactively prompt for command arguments and flags
DESCRIPTION
selects the EXPLAIN output format to be used
The allowed values are text, xml, json, and yaml. The default is text.
See code: src/commands/pg/settings/auto-explain/log-format.ts
Sets the minimum execution time in milliseconds for a statement's plan to be logged.
USAGE
$ heroku pg:settings:auto-explain:log-min-duration [DATABASE] [VALUE] -a <value> [--prompt] [-r <value>]
ARGUMENTS
[DATABASE] config var containing the connection string, unique name, ID, or alias of the database. To access another
app's database, prepend the app name to the config var or alias with `APP_NAME::` . If omitted, we use
DATABASE_URL.
[VALUE] minimum duration in milliseconds for queries before logging execution plans. A value of -1 disables it. A
value of 0 logs all query execution plans.
FLAGS
-a, --app=<value> (required) app to run command against
-r, --remote=<value> git remote of app to use
GLOBAL FLAGS
--prompt interactively prompt for command arguments and flags
DESCRIPTION
Sets the minimum execution time in milliseconds for a statement's plan to be logged.
Setting this value to 0 will log all queries. Setting this value to -1 will disable logging entirely.
See code: src/commands/pg/settings/auto-explain/log-min-duration.ts
Nested statements are included in the execution plan's log.
USAGE
$ heroku pg:settings:auto-explain:log-nested-statements [DATABASE] [VALUE] -a <value> [--prompt] [-r <value>]
ARGUMENTS
[DATABASE] config var containing the connection string, unique name, ID, or alias of the database. To access another
app's database, prepend the app name to the config var or alias with `APP_NAME::` . If omitted, we use
DATABASE_URL.
[VALUE] boolean indicating if execution plan logs include nested statements
FLAGS
-a, --app=<value> (required) app to run command against
-r, --remote=<value> git remote of app to use
GLOBAL FLAGS
--prompt interactively prompt for command arguments and flags
DESCRIPTION
Nested statements are included in the execution plan's log.
See code: src/commands/pg/settings/auto-explain/log-nested-statements.ts
Includes trigger execution statistics in execution plan logs.
USAGE
$ heroku pg:settings:auto-explain:log-triggers [DATABASE] [VALUE] -a <value> [--prompt] [-r <value>]
ARGUMENTS
[DATABASE] config var containing the connection string, unique name, ID, or alias of the database. To access another
app's database, prepend the app name to the config var or alias with `APP_NAME::` . If omitted, we use
DATABASE_URL.
[VALUE] boolean indicating if the database has trigger execution statistics enabled
FLAGS
-a, --app=<value> (required) app to run command against
-r, --remote=<value> git remote of app to use
GLOBAL FLAGS
--prompt interactively prompt for command arguments and flags
DESCRIPTION
Includes trigger execution statistics in execution plan logs.
This parameter can only be used in conjunction with pg:settings:auto-explain:log-analyze turned on.
See code: src/commands/pg/settings/auto-explain/log-triggers.ts
Include verbose details in execution plans.
USAGE
$ heroku pg:settings:auto-explain:log-verbose [DATABASE] [VALUE] -a <value> [--prompt] [-r <value>]
ARGUMENTS
[DATABASE] config var containing the connection string, unique name, ID, or alias of the database. To access another
app's database, prepend the app name to the config var or alias with `APP_NAME::` . If omitted, we use
DATABASE_URL.
[VALUE] boolean indicating if the database has verbose execution plan logging enabled
FLAGS
-a, --app=<value> (required) app to run command against
-r, --remote=<value> git remote of app to use
GLOBAL FLAGS
--prompt interactively prompt for command arguments and flags
DESCRIPTION
Include verbose details in execution plans.
This is equivalent to calling EXPLAIN VERBOSE.
See code: src/commands/pg/settings/auto-explain/log-verbose.ts
displays stats on replication slots on your database, the default value is "off"
USAGE
$ heroku pg:settings:data-connector-details-logs [DATABASE] [VALUE] -a <value> [--prompt] [-r <value>]
ARGUMENTS
[DATABASE] config var containing the connection string, unique name, ID, or alias of the database. To access another
app's database, prepend the app name to the config var or alias with `APP_NAME::` . If omitted, we use
DATABASE_URL.
[VALUE] boolean indicating if data replication slot details get logged
FLAGS
-a, --app=<value> (required) app to run command against
-r, --remote=<value> git remote of app to use
GLOBAL FLAGS
--prompt interactively prompt for command arguments and flags
DESCRIPTION
displays stats on replication slots on your database, the default value is "off"
ALIASES
$ heroku pg:settings:explain-data-connector-details
See code: src/commands/pg/settings/data-connector-details-logs.ts
displays stats on replication slots on your database, the default value is "off"
USAGE
$ heroku pg:settings:explain-data-connector-details [DATABASE] [VALUE] -a <value> [--prompt] [-r <value>]
ARGUMENTS
[DATABASE] config var containing the connection string, unique name, ID, or alias of the database. To access another
app's database, prepend the app name to the config var or alias with `APP_NAME::` . If omitted, we use
DATABASE_URL.
[VALUE] boolean indicating if data replication slot details get logged
FLAGS
-a, --app=<value> (required) app to run command against
-r, --remote=<value> git remote of app to use
GLOBAL FLAGS
--prompt interactively prompt for command arguments and flags
DESCRIPTION
displays stats on replication slots on your database, the default value is "off"
ALIASES
$ heroku pg:settings:explain-data-connector-details
Controls whether a log message is produced when a login attempt is made. Default is true.
USAGE
$ heroku pg:settings:log-connections [DATABASE] [VALUE] -a <value> [--prompt] [-r <value>]
ARGUMENTS
[DATABASE] config var containing the connection string, unique name, ID, or alias of the database. To access another
app's database, prepend the app name to the config var or alias with `APP_NAME::` . If omitted, we use
DATABASE_URL.
[VALUE] boolean indicating if database login attempts get logged
FLAGS
-a, --app=<value> (required) app to run command against
-r, --remote=<value> git remote of app to use
GLOBAL FLAGS
--prompt interactively prompt for command arguments and flags
DESCRIPTION
Controls whether a log message is produced when a login attempt is made. Default is true.
Setting log_connections to false stops emitting log messages for all attempts to login to the database.
See code: src/commands/pg/settings/log-connections.ts
Controls whether a log message is produced when a session waits longer than the deadlock_timeout to acquire a lock. deadlock_timeout is set to 1 second
USAGE
$ heroku pg:settings:log-lock-waits [DATABASE] [VALUE] -a <value> [--prompt] [-r <value>]
ARGUMENTS
[DATABASE] config var containing the connection string, unique name, ID, or alias of the database. To access another
app's database, prepend the app name to the config var or alias with `APP_NAME::` . If omitted, we use
DATABASE_URL.
[VALUE] boolean indicating if a message gets logged when a session waits longer than the deadlock_timeout to
acquire a lock
FLAGS
-a, --app=<value> (required) app to run command against
-r, --remote=<value> git remote of app to use
GLOBAL FLAGS
--prompt interactively prompt for command arguments and flags
DESCRIPTION
Controls whether a log message is produced when a session waits longer than the deadlock_timeout to acquire a lock.
deadlock_timeout is set to 1 second
Delays due to lock contention occur when multiple transactions are trying to access the same resource at the same
time.
Applications and their query patterns should try to avoid changes to many different tables within the same
transaction.
See code: src/commands/pg/settings/log-lock-waits.ts
The duration of each completed statement will be logged if the statement completes after the time specified by VALUE.
USAGE
$ heroku pg:settings:log-min-duration-statement [DATABASE] [VALUE] -a <value> [--prompt] [-r <value>]
ARGUMENTS
[DATABASE] config var containing the connection string, unique name, ID, or alias of the database. To access another
app's database, prepend the app name to the config var or alias with `APP_NAME::` . If omitted, we use
DATABASE_URL.
[VALUE] milliseconds to wait for a statement to complete before logging it
FLAGS
-a, --app=<value> (required) app to run command against
-r, --remote=<value> git remote of app to use
GLOBAL FLAGS
--prompt interactively prompt for command arguments and flags
DESCRIPTION
The duration of each completed statement will be logged if the statement completes after the time specified by VALUE.
VALUE needs to specified as a whole number, in milliseconds.
Setting log_min_duration_statement to zero prints all statement durations and -1 will disable logging statement
durations.
See code: src/commands/pg/settings/log-min-duration-statement.ts
log-min-error-statement controls the logging of SQL statements that cause an error at a specified severity level.
USAGE
$ heroku pg:settings:log-min-error-statement [DATABASE] [VALUE] -a <value> [--prompt] [-r <value>]
ARGUMENTS
[DATABASE] config var containing the connection string, unique name, ID, or alias of the database. To access another
app's database, prepend the app name to the config var or alias with `APP_NAME::` . If omitted, we use
DATABASE_URL.
[VALUE] (error|log|fatal|panic)
FLAGS
-a, --app=<value> (required) app to run command against
-r, --remote=<value> git remote of app to use
GLOBAL FLAGS
--prompt interactively prompt for command arguments and flags
DESCRIPTION
log-min-error-statement controls the logging of SQL statements that cause an error at a specified severity level.
This setting is useful to prevent logging SQL statements that might contain sensitive information.
Use this setting to prevent logging SQL queries that contain sensitive information. Default is "error".
See code: src/commands/pg/settings/log-min-error-statement.ts
log_statement controls which SQL statements are logged.
USAGE
$ heroku pg:settings:log-statement [DATABASE] [VALUE] -a <value> [--prompt] [-r <value>]
ARGUMENTS
[DATABASE] config var containing the connection string, unique name, ID, or alias of the database. To access another
app's database, prepend the app name to the config var or alias with `APP_NAME::` . If omitted, we use
DATABASE_URL.
[VALUE] (none|ddl|mod|all) type of SQL statements to log
<options: none|ddl|mod|all>
FLAGS
-a, --app=<value> (required) app to run command against
-r, --remote=<value> git remote of app to use
GLOBAL FLAGS
--prompt interactively prompt for command arguments and flags
DESCRIPTION
log_statement controls which SQL statements are logged.
Valid values for VALUE:
none - No statements are logged
ddl - All data definition statements, such as CREATE, ALTER and DROP will be logged
mod - Includes all statements from ddl as well as data-modifying statements such as INSERT, UPDATE, DELETE, TRUNCATE,
COPY
all - All statements are logged
See code: src/commands/pg/settings/log-statement.ts
track_functions controls tracking of function call counts and time used. Default is none.
USAGE
$ heroku pg:settings:track-functions [DATABASE] [VALUE] -a <value> [--prompt] [-r <value>]
ARGUMENTS
[DATABASE] config var containing the connection string, unique name, ID, or alias of the database. To access another
app's database, prepend the app name to the config var or alias with `APP_NAME::` . If omitted, we use
DATABASE_URL.
[VALUE] (none|pl|all) function type to track
<options: none|pl|all>
FLAGS
-a, --app=<value> (required) app to run command against
-r, --remote=<value> git remote of app to use
GLOBAL FLAGS
--prompt interactively prompt for command arguments and flags
DESCRIPTION
track_functions controls tracking of function call counts and time used. Default is none.
Valid values for VALUE:
none - No functions are tracked (default)
pl - Only procedural language functions are tracked
all - All functions, including SQL and C language functions, are tracked. Simple SQL-language that are inlined are
not tracked
See code: src/commands/pg/settings/track-functions.ts
stop a replica from following and make it a writeable database
USAGE
$ heroku pg:unfollow DATABASE -a <value> [--prompt] [-c <value>] [-r <value>]
ARGUMENTS
DATABASE config var containing the connection string, unique name, ID, or alias of the database. To access another
app's database, prepend the app name to the config var or alias with `APP_NAME::`
FLAGS
-a, --app=<value> (required) app to run command against
-c, --confirm=<value>
-r, --remote=<value> git remote of app to use
GLOBAL FLAGS
--prompt interactively prompt for command arguments and flags
DESCRIPTION
stop a replica from following and make it a writeable database
See code: src/commands/pg/unfollow.ts
cancels a scheduled upgrade. You can't cancel a version upgrade that's in progress.
USAGE
$ heroku pg:upgrade:cancel [DATABASE] -a <value> [--prompt] [-c <value>]
ARGUMENTS
[DATABASE] config var containing the connection string, unique name, ID, or alias of the database. To access another
app's database, prepend the app name to the config var or alias with `APP_NAME::` . If omitted, we use
DATABASE_URL.
FLAGS
-a, --app=<value> (required) app to run command against
-c, --confirm=<value>
GLOBAL FLAGS
--prompt interactively prompt for command arguments and flags
DESCRIPTION
cancels a scheduled upgrade. You can't cancel a version upgrade that's in progress.
See code: src/commands/pg/upgrade/cancel.ts
simulates a Postgres version upgrade on a Standard-tier and higher leader database by creating and upgrading a follower database. Heroku sends the results of the test upgrade via email.
USAGE
$ heroku pg:upgrade:dryrun [DATABASE] -a <value> [--prompt] [-c <value>] [-v <value>]
ARGUMENTS
[DATABASE] config var containing the connection string, unique name, ID, or alias of the database. To access another
app's database, prepend the app name to the config var or alias with `APP_NAME::` . If omitted, we use
DATABASE_URL.
FLAGS
-a, --app=<value> (required) app to run command against
-c, --confirm=<value>
-v, --version=<value> Postgres version to upgrade to
GLOBAL FLAGS
--prompt interactively prompt for command arguments and flags
DESCRIPTION
simulates a Postgres version upgrade on a Standard-tier and higher leader database by creating and upgrading a
follower database. Heroku sends the results of the test upgrade via email.
See code: src/commands/pg/upgrade/dryrun.ts
prepares the upgrade for Standard-tier and higher leader databases and schedules it for the next available maintenance window. To start a version upgrade on Essential-tier and follower databases, use heroku pg:upgrade:run instead.
USAGE
$ heroku pg:upgrade:prepare [DATABASE] -a <value> [--prompt] [-c <value>] [-v <value>]
ARGUMENTS
[DATABASE] config var containing the connection string, unique name, ID, or alias of the database. To access another
app's database, prepend the app name to the config var or alias with `APP_NAME::` . If omitted, we use
DATABASE_URL.
FLAGS
-a, --app=<value> (required) app to run command against
-c, --confirm=<value>
-v, --version=<value> Postgres version to upgrade to
GLOBAL FLAGS
--prompt interactively prompt for command arguments and flags
DESCRIPTION
prepares the upgrade for Standard-tier and higher leader databases and schedules it for the next available maintenance
window. To start a version upgrade on Essential-tier and follower databases, use heroku pg:upgrade:run instead.
See code: src/commands/pg/upgrade/prepare.ts
starts a Postgres version upgrade
USAGE
$ heroku pg:upgrade:run [DATABASE] -a <value> [--prompt] [-c <value>] [-r <value>] [-v <value>]
ARGUMENTS
[DATABASE] config var containing the connection string, unique name, ID, or alias of the database. To access another
app's database, prepend the app name to the config var or alias with `APP_NAME::` . If omitted, we use
DATABASE_URL.
FLAGS
-a, --app=<value> (required) app to run command against
-c, --confirm=<value>
-r, --remote=<value> git remote of app to use
-v, --version=<value> Postgres version to upgrade to
GLOBAL FLAGS
--prompt interactively prompt for command arguments and flags
DESCRIPTION
starts a Postgres version upgrade
On Essential-tier databases, this command upgrades the database's Postgres version.
On Standard-tier and higher leader databases, this command runs a previously scheduled Postgres version upgrade. You
must run pg:upgrade:prepare before this command to schedule a version upgrade.
On follower databases, this command unfollows the leader database before upgrading the follower's Postgres version.
EXAMPLES
# Upgrade an Essential-tier database to a specific version
$ heroku pg:upgrade:run postgresql-curved-12345 --version 14 --app myapp
# Upgrade a Standard-tier follower database to the latest supported version
$ heroku pg:upgrade:run HEROKU_POSTGRESQL_BLUE_URL --app myapp
# Run a previously scheduled upgrade on a Standard-tier leader database
$ heroku pg:upgrade:run DATABASE_URL --app myapp
See code: src/commands/pg/upgrade/run.ts
provides the status of an upgrade and blocks it until the operation is complete
USAGE
$ heroku pg:upgrade:wait [DATABASE] -a <value> [--prompt] [--no-notify] [-r <value>] [--wait-interval <value>]
ARGUMENTS
[DATABASE] config var containing the connection string, unique name, ID, or alias of the database. To access another
app's database, prepend the app name to the config var or alias with `APP_NAME::`
FLAGS
-a, --app=<value> (required) app to run command against
-r, --remote=<value> git remote of app to use
--no-notify do not show OS notification
--wait-interval=<value> how frequently to poll in seconds (to avoid rate limiting)
GLOBAL FLAGS
--prompt interactively prompt for command arguments and flags
DESCRIPTION
provides the status of an upgrade and blocks it until the operation is complete
EXAMPLES
# Wait for upgrade to complete with default settings
$ heroku pg:upgrade:wait postgresql-curved-12345 --app myapp
# Wait with custom polling interval
$ heroku pg:upgrade:wait postgresql-curved-12345 --app myapp --wait-interval 10
# Wait without showing OS notifications
$ heroku pg:upgrade:wait postgresql-curved-12345 --app myapp --no-notify
See code: src/commands/pg/upgrade/wait.ts
show dead rows and whether an automatic vacuum is expected to be triggered
USAGE
$ heroku pg:vacuum-stats [DATABASE] -a <value> [--prompt] [-r <value>]
ARGUMENTS
[DATABASE] config var containing the connection string, unique name, ID, or alias of the database. To access another
app's database, prepend the app name to the config var or alias with `APP_NAME::` . If omitted, we use
DATABASE_URL.
FLAGS
-a, --app=<value> (required) app to run command against
-r, --remote=<value> git remote of app to use
GLOBAL FLAGS
--prompt interactively prompt for command arguments and flags
DESCRIPTION
show dead rows and whether an automatic vacuum is expected to be triggered
See code: src/commands/pg/vacuum-stats.ts
blocks until database is available
USAGE
$ heroku pg:wait [DATABASE] -a <value> [--prompt] [--wait-interval <value>] [--no-notify] [-r <value>]
ARGUMENTS
[DATABASE] config var containing the connection string, unique name, ID, or alias of the database. To access another
app's database, prepend the app name to the config var or alias with `APP_NAME::` . If omitted, we use all
databases.
FLAGS
-a, --app=<value> (required) app to run command against
-r, --remote=<value> git remote of app to use
--no-notify do not show OS notification
--wait-interval=<value> how frequently to poll in seconds (to avoid rate limiting)
GLOBAL FLAGS
--prompt interactively prompt for command arguments and flags
DESCRIPTION
blocks until database is available
See code: src/commands/pg/wait.ts