Last updated May 18, 2026
Heroku Postgres Advanced is in limited general availability. To start creating and using Advanced databases, open a ticket with Heroku Support to request access. Subscribe to our changelog to stay informed of when Heroku Postgres Advanced is generally available.
Heroku Postgres Advanced (Limited GA), Standard, Premium, Private, and Shield plans can manage database settings by configuring parameters via the data:pg:settings and the pg:settings command.
The pg:settings:* commands are only for classic Postgres databases which include Standard, Premium, Private, and Shield. Use data:pg:settings for Advanced databases and you can set multiple settings at one time. For example, this command sets log-lock-waits and log-min-duration-statement on an Advanced database:
$ heroku data:pg:settings postgresql-large-1234 --set=log_lock_waits:off --set=log_min_duration_statement=3000 -a example-app
Updating these settings...
Setting From To
──────────────── ──── ──────────────
log_lock_waits on off
log_min_duration_statement 1500 3000
Updating your database postgresql-large-1234 shortly. You can use heroku data:pg:info postgresql-large-1234 -a example-app to track progress.
Settings in the pg:settings:* commands are formatted with a dash (-), for example, log-lock-waits. Settings in the data:pg:settings command are formatted with an underscore (_), for example, log_lock_waits.
View Settings
To view the current settings on your database, use data:pg:settings on Advanced databases:
$ heroku data:pg:settings postgresql-large-1234 -a example-app
=== postgresql-large-1234
Setting Value
────────────────────────────────── ─────
log_connections true
log_lock_waits true
log_min_duration_statement 500
log_min_error_statement info
log_statement ddl
track_functions pl
auto_explain.log_analyze false
auto_explain.log_buffers false
auto_explain.log_format text
auto_explain.log_min_duration 200
auto_explain.log_nested_statements false
auto_explain.log_triggers false
auto_explain.log_verbose false
Use pg:settings for classic databases:
$ heroku pg:settings postgresql-large-1234 -a example-app
=== postgresql-large-1234
auto-explain: false
auto-explain.log-analyze: false
auto-explain.log-buffers: false
auto-explain.log-format: text
auto-explain.log-min-duration: -1
auto-explain.log-nested-statements: false
auto-explain.log-triggers: false
auto-explain.log-verbose: false
data-connector-details-logs: false
log-connections: true
log-lock-waits: true
log-min-duration-statement: 2000
log-min-error-statement: error
log-statement: ddl
track-functions: none
log-lock-waits
log-lock-waits controls whether a log message is produced when a session waits longer than 1 second to acquire a lock. Long lock waits can cause performance issues.
The default value is on.
In Advanced (Limited GA) databases:
$ heroku data:pg:settings postgresql-large-1234 --set=log_lock_waits:off -a example-app
Updating these settings...
Setting From To
──────────────── ──── ──────────────
log_lock_waits on off
Updating your database postgresql-large-1234 shortly. You can use heroku data:pg:info postgresql-large-1234 -a example-app to track progress.
In classic databases:
$ heroku pg:settings:log-lock-waits postgresql-large-1234 off -a example-app
log-lock-waits has been set to false for postgresql-large-1234.
When a deadlock is detected, no log message will be emitted in your application's logs.
log-min-duration-statement
log-min-duration-statement logs the duration of each completed statement if the statement ran for at least the specified number of milliseconds. A value of 0 logs every statement. A value of -1 disables logging. This setting helps you track down slow or unoptimized queries.
The default value is 2000 milliseconds or 2 seconds.
On a system with hundreds of queries executing every second, log files can grow quickly and affect database performance.
In Advanced (Limited GA) databases:
$ heroku data:pg:settings postgresql-large-1234 --set=log_min_duration_statement:3000 -a example-app
Updating these settings...
Setting From To
──────────────── ──── ──────────────
log_min_duration_statement 1500 3000
Updating your database postgresql-large-1234 shortly. You can use heroku data:pg:info postgresql-large-1234 -a example-app to track progress.
In classic databases:
$ heroku pg:settings:log-min-duration-statement postgresql-large-1234 3000 -a example-app
log-min-duration-statement has been set to 3000 for postgresql-large-1234.
log-min-error-statement
log_min_error_statement controls whether the SQL statement that caused an error is logged based on the error’s severity. Use this setting to prevent logging SQL queries that contain sensitive information. The valid values for log_min_error_statement are:
errorlogfatalpanic
When you configure a severity level, the statement is logged for any errors of the specified severity or higher.
The default value is error. This setting logs the statement for errors with severity error, log, fatal, and panic.
In Advanced (Limited GA) databases:
$ heroku data:pg:settings postgresql-large-1234 --set=log_min_error_statement:panic -a example-app
Updating these settings...
Setting From To
──────────────── ──── ──────────────
log_min_duration_statement error panic
Updating your database postgresql-large-1234 shortly. You can use heroku data:pg:info postgresql-large-1234 -a example-app to track progress.
In classic databases:
$ heroku pg:settings:log-min-error-statement postgresql-large-1234 panic -a example-app
log-min-error-statement has been set to panic for postgresql-large-1234.
Logs only PANIC level messages.
log-statement
log-statement controls which normal SQL statements are logged. This setting can help you debug complex queries or audit queries made by your app or database users. Valid values for log-statement are:
none: Don’t log normal queries. Other logs still generate such as slow query logs, queries waiting in locks, and syntax errorsddl: Log all data definition statements, such asCREATE,ALTER, andDROP.mod: Log all statements from DDL and data-modifying statements such asINSERT,UPDATE,DELETE,TRUNCATE, andCOPY.all: Log all statements.
The default value is ddl.
In Advanced (Limited GA) databases:
$ heroku data:pg:settings postgresql-large-1234 --set=log_statement:all -a example-app
Updating these settings...
Setting From To
──────────────── ──── ──────────────
log_statement none all
Updating your database postgresql-large-1234 shortly. You can use heroku data:pg:info postgresql-large-1234 -a example-app to track progress.
In classic databases:
$ heroku pg:settings:log-statement postgresql-large-1234 all -a example-app
log-statement has been set to all for postgresql-large-1234.
track-functions
track-functions controls which functions have their execution statistics tracked. These statistics can be found in the pg_stat_user_functions view. Valid values for track-functions are:
none: No function statistics are recorded.pl: Procedural language function statistics are recorded (for example, PL/pgSQL functions).all: All functions, including SQL and C language function statistics are recorded.
This default value is none.
In Advanced (Limited GA) databases:
$ heroku data:pg:settings postgresql-large-1234 --set=track_functions:pl -a example-app
Updating these settings...
Setting From To
──────────────── ──── ──────────────
track_functions none pl
Updating your database postgresql-large-1234 shortly. You can use heroku data:pg:info postgresql-large-1234 -a example-app to track progress.
In classic databases:
$ heroku pg:settings:track-functions postgresql-large-1234 pl -a example-app
track-functions has been set to pl for postgresql-large-1234.
Track only procedural-language functions.
data-connector-details-logs
data-connector-details-logs isn’t supported on Heroku Postgres Advanced (Limited GA) databases. Subscribe to our changelog to stay informed of when this setting is available for Advanced databases.
data-connector-details-logs controls whether detailed statistics for data connectors are emitted to the database logs when you use Streaming Data Connectors. See Heroku Postgres Metrics Logs for the list of metrics.
The default value is off.
$ heroku pg:settings:data-connector-details-logs postgresql-large-1234 on -a example-app
data-connector-details-logs has been set to on for postgresql-large-1234.
auto-explain
auto_explain logs query execution plans automatically without having to run EXPLAIN manually. auto_explain can help identify slow or expensive queries and understand how to optimize them. auto_explain is enabled by default on Advanced (Limited GA) databases. On classic databases, enable auto_explain with:
$ heroku pg:settings:auto-explain postgresql-large-1234 on -a example-app
Enabling auto_explain can cause increased log volume and affect performance. Use it with caution and monitor your database performance. auto_explain enables the module for all future Heroku Postgres connections. Existing connections must reconnect before auto_explain logging takes effect.
The following settings tune auto_explain behavior. You must enable auto_explain to use these settings.
auto-explain:log-analyze
log-analyze runs EXPLAIN ANALYZE on all queries regardless if they’re logged or not. This setting can have a significant performance impact on your database so use with caution.
The default value is off.
In Advanced (Limited GA) databases:
$ heroku data:pg:settings postgresql-large-1234 --set=auto_explain.log_analyze:on -a example-app
Updating these settings...
Setting From To
──────────────── ──── ──────────────
auto_explain.log_analyze off on
Updating your database postgresql-large-1234 shortly. You can use heroku data:pg:info postgresql-large-1234 -a example-app to track progress.
In classic databases:
$ heroku pg:settings:auto-explain:log-analyze postgresql-large-1234 on -a example-app
auto-explain:log-buffers
log-buffers is equivalent to the BUFFERS option of EXPLAIN. You can only use it when auto-explain:log-analyze is on.
The default value is off.
In Advanced (Limited GA) databases:
$ heroku data:pg:settings postgresql-large-1234 --set=auto_explain.log_buffers:on -a example-app
Updating these settings...
Setting From To
──────────────── ──── ──────────────
auto_explain.log_buffers off on
Updating your database postgresql-large-1234 shortly. You can use heroku data:pg:info postgresql-large-1234 -a example-app to track progress.
In classic databases:
$ heroku pg:settings:auto-explain:log-buffers postgresql-large-1234 on -a example-app
auto-explain:log-format
log-format sets the output format for the EXPLAIN command. The valid values are:
textxmljsonyaml
The default value is text.
In Advanced (Limited GA) databases:
$ heroku data:pg:settings postgresql-large-1234 --set=auto_explain.log_format:on -a example-app
Updating these settings...
Setting From To
──────────────── ──── ──────────────
auto_explain.log_format text json
Updating your database postgresql-large-1234 shortly. You can use heroku data:pg:info postgresql-large-1234 -a example-app to track progress.
In classic databases:
$ heroku pg:settings:auto-explain:log-format postgresql-large-1234 json -a example-app
auto-explain:log-min-duration
log-min-duration sets the minimum log duration in milliseconds for a query to have its plan logged. A value of-1 disables all logging. A value of 0 logs all executed queries.
The default value is -1.
In Advanced (Limited GA) databases:
$ heroku data:pg:settings postgresql-large-1234 --set=auto_explain.log_min_duration:on -a example-app
Updating these settings...
Setting From To
────────────────── ──── ──────────────
auto_explain.log_min_duration 0 200
Updating your database postgresql-large-1234 shortly. You can use heroku data:pg:info postgresql-large-1234 -a example-app to track progress.
In classic databases:
$ heroku pg:settings:auto-explain:log-min-duration postgresql-large-1234 200 -a example-app
auto-explain:log-nested-statements
log-nested-statements includes nested statements, such as from functions, to the execution plan’s log.
The default value is off.
In Advanced (Limited GA) databases:
$ heroku data:pg:settings postgresql-large-1234 --set=auto_explain.log_nested_statements:on -a example-app
Updating these settings...
Setting From To
───────────────────── ──── ──────────────
auto_explain.log_nested_statements off on
Updating your database postgresql-large-1234 shortly. You can use heroku data:pg:info postgresql-large-1234 -a example-app to track progress.
In classic databases:
$ heroku pg:settings:auto-explain:log-nested-statements postgresql-large-1234 on -a example-app
auto-explain:log-triggers
log-triggers includes trigger execution statistics in the execution plan’s logs.
The default value is off.
In Advanced (Limited GA) databases:
$ heroku data:pg:settings postgresql-large-1234 --set=auto_explain.log_triggers:on -a example-app
Updating these settings...
Setting From To
──────────────── ──── ──────────────
auto_explain.log_triggers off on
Updating your database postgresql-large-1234 shortly. You can use heroku data:pg:info postgresql-large-1234 -a example-app to track progress.
In classic databases:
$ heroku pg:settings:auto-explain:log-triggers postgresql-large-1234 on -a example-app
auto-explain:log-verbose
log-verbose includes verbose details in the execution plan’s logs. This setting is equivalent to the VERBOSE option of EXPLAIN.
The default value is off.
In Advanced (Limited GA) databases:
$ heroku data:pg:settings postgresql-large-1234 --set=auto_explain.log_verbose:on -a example-app
Updating these settings...
Setting From To
──────────────── ──── ──────────────
auto_explain.log_verbose off on
Updating your database postgresql-large-1234 shortly. You can use heroku data:pg:info postgresql-large-1234 -a example-app to track progress.
In classic databases:
$ heroku pg:settings:auto-explain:log-verbose postgresql-large-1234 on -a example-app