Working with parameters on your RDS for PostgreSQL DB instance
In some cases, you might create an RDS for PostgreSQL DB instance without specifying a custom
parameter group. If so, your DB instance is created using the default parameter group for the
version of PostgreSQL that you choose. For example, suppose that you create an RDS for PostgreSQL
DB instance using PostgreSQL 13.3. In this case, the DB instance is created using the values
in the parameter group for PostgreSQL 13 releases, default.postgres13
.
You can also create your own custom DB parameter group. You need to do this if you want to modify any settings for the RDS for PostgreSQL DB instance from their default values. To learn how, see Parameter groups for Amazon RDS.
You can track the settings on your RDS for PostgreSQL DB instance in several different ways.
You can use the AWS Management Console, the AWS CLI, or the Amazon RDS API. You can also query the values from the
PostgreSQL pg_settings
table of your instance, as shown following.
SELECT name, setting, boot_val, reset_val, unit FROM pg_settings ORDER BY name;
To learn more about the values returned from this query, see pg_settings
Be especially careful when changing the settings for max_connections
and
shared_buffers
on your RDS for PostgreSQL DB instance. For example, suppose that you
modify settings for max_connections
or shared_buffers
and you use
values that are too high for your actual workload. In this case, your RDS for PostgreSQL DB
instance won't start. If this happens, you see an error such as the following in the
postgres.log
.
2018-09-18 21:13:15 UTC::@:[8097]:FATAL: could not map anonymous shared memory: Cannot allocate memory
2018-09-18 21:13:15 UTC::@:[8097]:HINT: This error usually means that PostgreSQL's request for a shared memory segment
exceeded available memory or swap space. To reduce the request size (currently 3514134274048 bytes), reduce
PostgreSQL's shared memory usage, perhaps by reducing shared_buffers or max_connections.
However, you can't change any values of the settings contained in the default RDS for PostgreSQL DB parameter groups. To change settings for any parameters, first create a custom DB parameter group. Then change the settings in that custom group, and then apply the custom parameter group to your RDS for PostgreSQL DB instance. To learn more, see Parameter groups for Amazon RDS.
There are two types of parameters in RDS for PostgreSQL.
Static parameters – Static parameters require that the RDS for PostgreSQL DB instance be rebooted after a change so that the new value can take effect.
Dynamic parameters – Dynamic parameters don't require a reboot after changing their settings.
Note
If your RDS for PostgreSQL DB instance is using your own custom DB parameter group, you can change the values of dynamic parameters on the running DB instance. You can do this by using the AWS Management Console, the AWS CLI, or the Amazon RDS API.
If you have privileges to do so, you can also change parameter values by using the ALTER
DATABASE
, ALTER ROLE
, and SET
commands.
RDS for PostgreSQL DB instance parameter list
The following table lists some (but not all) parameters available in an RDS for PostgreSQL DB instance. To view all available parameters, you use the describe-db-parameters AWS CLI command. For example, to get the list of all parameters available in the default parameter group for RDS for PostgreSQL version 13, run the following.
aws rds describe-db-parameters --db-parameter-group-name default.postgres13
You can also use the Console. Choose Parameter groups from the Amazon RDS menu, and then choose the parameter group from those available in your AWS Region.
Parameter name |
Apply_Type |
Description |
---|---|---|
|
Dynamic | Sets the application name to be reported in statistics and logs. |
|
Dynamic | Sets the shell command that will be called to archive a WAL file. |
|
Dynamic | Enables input of NULL elements in arrays. |
|
Dynamic | Sets the maximum allowed time to complete client authentication. |
|
Dynamic | Starts the autovacuum subprocess. |
|
Dynamic | Number of tuple inserts, updates, or deletes before analyze as a fraction of reltuples. |
|
Dynamic | Minimum number of tuple inserts, updates, or deletes before analyze. |
|
Static | Age at which to autovacuum a table to prevent transaction ID wraparound. |
|
Dynamic | Time to sleep between autovacuum runs. |
|
Static | Sets the maximum number of simultaneously running autovacuum worker processes. |
|
Dynamic | Vacuum cost delay, in milliseconds, for autovacuum. |
|
Dynamic | Vacuum cost amount available before napping, for autovacuum. |
|
Dynamic | Number of tuple updates or deletes before vacuum as a fraction of reltuples. |
|
Dynamic | Minimum number of tuple updates or deletes before vacuum. |
|
Dynamic | Sets whether a backslash (\) is allowed in string literals. |
|
Dynamic | Background writer sleep time between rounds. |
|
Dynamic | Background writer maximum number of LRU pages to flush per round. |
|
Dynamic | Multiple of the average buffer usage to free per round. |
|
Dynamic | Sets the output format for bytes. |
|
Dynamic | Checks function bodies during CREATE FUNCTION. |
|
Dynamic | Time spent flushing dirty buffers during checkpoint, as a fraction of the checkpoint interval. |
|
Dynamic | Sets the maximum distance in log segments between automatic write-ahead log (WAL) checkpoints. |
|
Dynamic | Sets the maximum time between automatic WAL checkpoints. |
|
Dynamic | Enables warnings if checkpoint segments are filled more frequently than this. |
|
Dynamic | Sets the time interval between checks for disconnection while running queries. |
|
Dynamic | Sets the client's character set encoding. |
|
Dynamic | Sets the message levels that are sent to the client. |
|
Dynamic | Sets the delay in microseconds between transaction commit and flushing WAL to disk. |
|
Dynamic | Sets the minimum concurrent open transactions before performing commit_delay. |
|
Dynamic | Enables the planner to use constraints to optimize queries. |
|
Dynamic | Sets the planner's estimate of the cost of processing each index entry during an index scan. |
|
Dynamic | Sets the planner's estimate of the cost of processing each operator or function call. |
|
Dynamic | Sets the planner's estimate of the cost of processing each tuple (row). |
|
Dynamic | Sets the planner's estimate of the fraction of a cursor's rows that will be retrieved. |
|
Dynamic | Sets the display format for date and time values. |
|
Dynamic | Sets the time to wait on a lock before checking for deadlock. |
|
Dynamic | Indents parse and plan tree displays. |
|
Dynamic | Logs each query's parse tree. |
|
Dynamic | Logs each query's execution plan. |
|
Dynamic | Logs each query's rewritten parse tree. |
|
Dynamic | Sets the default statistics target. |
|
Dynamic | Sets the default tablespace to create tables and indexes in. |
|
Dynamic | Sets the default deferrable status of new transactions. |
|
Dynamic | Sets the transaction isolation level of each new transaction. |
|
Dynamic | Sets the default read-only status of new transactions. |
|
Dynamic | Creates new tables with object IDs (OIDs) by default. |
|
Dynamic | Sets the planner's assumption about the size of the disk cache. |
|
Dynamic | Number of simultaneous requests that can be handled efficiently by the disk subsystem. |
|
Dynamic | Enables the planner's use of bitmap-scan plans. |
|
Dynamic | Enables the planner's use of hashed aggregation plans. |
|
Dynamic | Enables the planner's use of hash join plans. |
|
Dynamic | Enables the planner's use of index-scan plans. |
|
Dynamic | Enables the planner's use of materialization. |
|
Dynamic | Enables the planner's use of merge join plans. |
|
Dynamic | Enables the planner's use of nested-loop join plans. |
|
Dynamic | Enables the planner's use of sequential-scan plans. |
|
Dynamic | Enables the planner's use of explicit sort steps. |
|
Dynamic | Enables the planner's use of TID scan plans. |
|
Dynamic | Warns about backslash (\) escapes in ordinary string literals. |
|
Dynamic | Sets the number of digits displayed for floating-point values. |
|
Dynamic | Sets the FROM-list size beyond which subqueries are not collapsed. |
|
Dynamic | Forces synchronization of updates to disk. |
|
Dynamic | Writes full pages to WAL when first modified after a checkpoint. |
|
Dynamic | Enables genetic query optimization. |
|
Dynamic | GEQO: effort is used to set the default for other GEQO parameters. |
|
Dynamic | GEQO: number of iterations of the algorithm. |
|
Dynamic | GEQO: number of individuals in the population. |
|
Dynamic | GEQO: seed for random path selection. |
|
Dynamic | GEQO: selective pressure within the population. |
|
Dynamic | Sets the threshold of FROM items beyond which GEQO is used. |
|
Dynamic | Sets the maximum allowed result for exact search by GIN. |
|
Dynamic | Determines whether a hot standby sends feedback messages to the primary or upstream standby. |
|
Dynamic | Sets the display format for interval values. |
|
Dynamic | Sets the FROM-list size beyond which JOIN constructs are not flattened. |
|
Dynamic | Sets the language in which messages are displayed. |
|
Dynamic | Sets the locale for formatting monetary amounts. |
|
Dynamic | Sets the locale for formatting numbers. |
|
Dynamic | Sets the locale for formatting date and time values. |
|
Dynamic | Sets the minimum running time above which autovacuum actions will be logged. |
|
Dynamic | Logs each checkpoint. |
|
Dynamic | Logs each successful connection. |
|
Dynamic | Logs end of a session, including duration. |
|
Dynamic | Logs the duration of each completed SQL statement. |
|
Dynamic | Sets the verbosity of logged messages. |
|
Dynamic | Writes executor performance statistics to the server log. |
|
Dynamic | Sets the file name pattern for log files. |
|
Dynamic | Sets file permissions for log files. Default value is 0644. |
|
Dynamic | Logs the host name in the connection logs. As of PostgreSQL 12 and later versions, this parameter is 'off' by default. When turned on, the connection uses DNS reverse-lookup to get the hostname that gets captured to the connection logs. If you turn on this parameter, you should monitor the impact that it has on the time it takes to establish connections. |
|
Dynamic | Controls information prefixed to each log line. |
|
Dynamic | Logs long lock waits. |
|
Dynamic | Sets the minimum running time above which statements will be logged. |
|
Dynamic | Causes all statements generating an error at or above this level to be logged. |
|
Dynamic | Sets the message levels that are logged. |
|
Dynamic | Writes parser performance statistics to the server log. |
|
Dynamic | Writes planner performance statistics to the server log. |
|
Dynamic | Automatic log file rotation will occur after N minutes. |
|
Dynamic | Automatic log file rotation will occur after N kilobytes. |
|
Dynamic | Sets the type of statements logged. |
|
Dynamic | Writes cumulative performance statistics to the server log. |
|
Dynamic | Logs the use of temporary files larger than this number of kilobytes. |
|
Dynamic | Sets the time zone to use in log messages. |
|
Dynamic | Truncate existing log files of same name during log rotation. |
|
Static | Start a subprocess to capture stderr output and/or csvlogs into log files. |
|
Dynamic | Sets the maximum memory to be used for maintenance operations. |
|
Static | Sets the maximum number of concurrent connections. |
|
Static | Sets the maximum number of simultaneously open files for each server process. |
|
Static | Sets the maximum number of locks per transaction. |
|
Static | Sets the maximum number of predicate locks per transaction. |
|
Static | Sets the maximum number of simultaneously prepared transactions. |
|
Dynamic | Sets the maximum stack depth, in kilobytes. |
|
Dynamic | Sets the maximum delay before canceling queries when a hot standby server is processing archived WAL data. |
|
Dynamic | Sets the maximum delay before canceling queries when a hot standby server is processing streamed WAL data. |
max_wal_size |
Dynamic | Sets the WAL size (MB) that triggers a checkpoint. For all versions
after RDS for PostgreSQL 10, the default is at least 1 GB (1024 MB). For example, max_wal_size setting for
RDS for PostgreSQL 14 is 2 GB (2048 MB). Use the SHOW max_wal_size;
command on your RDS for PostgreSQL DB instance to see its current value. |
min_wal_size |
Dynamic | Sets the minimum size to shrink the WAL to. For PostgreSQL version 9.6 and
earlier, min_wal_size is in units of 16 MB. For PostgreSQL version 10 and
later, min_wal_size is in units of 1 MB. |
|
Dynamic | Adds quotes (") to all identifiers when generating SQL fragments. |
|
Dynamic | Sets the planner's estimate of the cost of a non-sequentially fetched disk
page. This parameter has no value unless query plan management (QPM) is turned on. When QPM
is on, the default value for this parameter 4 .
|
rds.adaptive_autovacuum |
Dynamic | Automatically tunes the autovacuum parameters whenever the transaction ID thresholds are exceeded. |
rds.force_ssl |
Dynamic | Requires the use of SSL connections. The default value is set to 1 (on) for RDS for PostgreSQL version 15. All other RDS for PostgreSQL major version 14 and older have the default value set to 0 (off). |
|
Static | Enables writing logical spill files to the local volume. |
|
Dynamic | Sets log retention such that Amazon RDS deletes PostgreSQL logs that are older than n minutes. |
rds.rds_superuser_reserved_connections |
Static | Sets the number of connection slots reserved for rds_superusers.
This parameter is only available in versions 15 and earlier. For more information, see the PostgreSQL documentation
reserved_connections |
rds.restrict_password_commands |
Static | Restricts who can manage passwords to users with the rds_password
role. Set this parameter to 1 to enable password restriction. The default is 0. |
|
Dynamic | Sets the schema search order for names that are not schema-qualified. |
|
Dynamic | Sets the planner's estimate of the cost of a sequentially fetched disk page. |
|
Dynamic | Sets the sessions behavior for triggers and rewrite rules. |
|
Static | Sets the number of shared memory buffers used by the server. |
|
Static | Lists the shared libraries to preload into the RDS for PostgreSQL DB instance. Supported values include auto_explain, orafce, pgaudit, pglogical, pg_bigm, pg_cron, pg_hint_plan, pg_prewarm, pg_similarity, pg_stat_statements, pg_tle, pg_transport, plprofiler, and plrust. |
|
Dynamic | Enables SSL connections. |
|
Dynamic | Causes subtables to be included by default in various commands. |
|
Dynamic | Sets the amount of traffic to send and receive before renegotiating the encryption keys. |
|
Dynamic | Causes ... strings to treat backslashes literally. |
|
Dynamic | Sets the maximum allowed duration of any statement. |
|
Dynamic | Enables synchronized sequential scans. |
|
Dynamic | Sets the current transactions synchronization level. |
|
Dynamic | Maximum number of TCP keepalive retransmits. |
|
Dynamic | Time between issuing TCP keepalives. |
|
Dynamic | Time between TCP keepalive retransmits. |
|
Dynamic | Sets the maximum number of temporary buffers used by each session. |
temp_file_limit |
Dynamic | Sets the maximum size in KB to which the temporary files can grow. |
|
Dynamic | Sets the tablespaces to use for temporary tables and sort files. |
|
Dynamic | Sets the time zone for displaying and interpreting time stamps. The Internet Assigned Numbers Authority (IANA) publishes new time zones at
https://www.iana.org/time-zones |
|
Dynamic | Collects information about running commands. |
|
Static | Sets the size reserved for pg_stat_activity.current_query, in bytes. |
|
Dynamic | Collects statistics on database activity. |
|
Dynamic | Collects function-level statistics on database activity. |
|
Dynamic | Collects timing statistics on database I/O activity. |
|
Dynamic | Indicates whether to defer a read-only serializable transaction until it can be started with no possible serialization failures. |
|
Dynamic | Sets the current transactions isolation level. |
|
Dynamic | Sets the current transactions read-only status. |
|
Dynamic | Treats expr=NULL as expr IS NULL. |
|
Dynamic | Updates the process title to show the active SQL command. |
|
Dynamic | Vacuum cost delay in milliseconds. |
|
Dynamic | Vacuum cost amount available before napping. |
|
Dynamic | Vacuum cost for a page dirtied by vacuum. |
|
Dynamic | Vacuum cost for a page found in the buffer cache. |
|
Dynamic | Vacuum cost for a page not found in the buffer cache. |
|
Dynamic | Number of transactions by which vacuum and hot cleanup should be deferred, if any. |
|
Dynamic | Minimum age at which vacuum should freeze a table row. |
|
Dynamic | Age at which vacuum should scan a whole table to freeze tuples. |
|
Static | Sets the number of disk-page buffers in shared memory for WAL. |
|
Dynamic | WAL writer sleep time between WAL flushes. |
|
Dynamic | Sets the maximum memory to be used for query workspaces. |
|
Dynamic | Sets how binary values are to be encoded in XML. |
|
Dynamic | Sets whether XML data in implicit parsing and serialization operations is to be considered as documents or content fragments. |
Amazon RDS uses the default PostgreSQL units for all parameters. The following table shows the PostgreSQL default unit for each parameter.
Parameter name |
Unit |
---|---|
| s |
| s |
| s |
| ms |
| ms |
| s |
| s |
| ms |
| 8 KB |
| ms |
| ms |
| ms |
| minutes |
| KB |
| KB |
| KB |
| KB |
| ms |
| ms |
| s |
| s |
| 8 KB |
| 8 KB |
| ms |
| KB |
| s |
| s |
| KB |
| KB |
| 8 KB |
| ms |
| 8 KB |
| ms |
| B |
| ms |
| ms |
| s |