

# Amazon Aurora PostgreSQL reference
<a name="AuroraPostgreSQL.Reference"></a>

In the following topics, you can find information about collations, functions, parameters, and wait events in Amazon Aurora PostgreSQL.

**Topics**
+ [Aurora PostgreSQL collations for EBCDIC and other mainframe migrations](#AuroraPostgreSQL.Reference.Collations.mainframe.migration)
+ [Collations supported in Aurora PostgreSQL](PostgreSQL-Collations.md)
+ [Aurora PostgreSQL functions reference](Appendix.AuroraPostgreSQL.Functions.md)
+ [Amazon Aurora PostgreSQL parameters](AuroraPostgreSQL.Reference.ParameterGroups.md)
+ [Amazon Aurora PostgreSQL wait events](AuroraPostgreSQL.Reference.Waitevents.md)

## Aurora PostgreSQL collations for EBCDIC and other mainframe migrations
<a name="AuroraPostgreSQL.Reference.Collations.mainframe.migration"></a>

Migrating mainframe applications to new platforms such as AWS ideally preserves application behavior. To preserve application behavior on a new platform exactly as it was on the mainframe requires that migrated data be collated using the same collation and sorting rules. For example, many Db2 migration solutions shift null values to u0180 (Unicode position 0180), so these collations sort u0180 first. This is one example of how collations can vary from their mainframe source and why it's necessary to choose a collation that better maps to the original EBCDIC collation. 

Aurora PostgreSQL 14.3 and higher versions provide many ICU and EBCDIC collations to support such migration to AWS using the AWS Mainframe Modernization service. To learn more about this service, see [What is AWS Mainframe Modernization?](https://docs.aws.amazon.com/m2/latest/userguide/what-is-m2.html) 

 In the following table, you can find Aurora PostgreSQL–provided collations. These collations follow EBCDIC rules and ensure that mainframe applications function the same on AWS as they did in the mainframe environment. The collation name includes the relevant code page, (cp*nnnn*), so that you can choose the appropriate collation for your mainframe source. For example, use `en-US-cp037-x-icu` for to achieve the collation behavior for EBCDIC data that originated from a mainframe application that used code page 037.


| EBCDIC collations  | AWS Blu Age collations | AWS Micro Focus collations | 
| --- | --- | --- | 
| da-DK-cp1142-x-icu | da-DK-cp1142b-x-icu | da-DK-cp1142m-x-icu | 
| da-DK-cp277-x-icu | da-DK-cp277b-x-icu | – | 
| de-DE-cp1141-x-icu | de-DE-cp1141b-x-icu | de-DE-cp1141m-x-icu | 
| de-DE-cp273-x-icu | de-DE-cp273b-x-icu | – | 
| en-GB-cp1146-x-icu | en-GB-cp1146b-x-icu | en-GB-cp1146m-x-icu | 
| en-GB-cp285-x-icu | en-GB-cp285b-x-icu | – | 
| en-US-cp037-x-icu | en-US-cp037b-x-icu | – | 
| en-US-cp1140-x-icu | en-US-cp1140b-x-icu | en-US-cp1140m-x-icu | 
| es-ES-cp1145-x-icu | es-ES-cp1145b-x-icu | es-ES-cp1145m-x-icu | 
| es-ES-cp284-x-icu | es-ES-cp284b-x-icu | – | 
| fi-FI-cp1143-x-icu | fi-FI-cp1143b-x-icu | fi-FI-cp1143m-x-icu | 
| fi-FI-cp278-x-icu | fi-FI-cp278b-x-icu | – | 
| fr-FR-cp1147-x-icu | fr-FR-cp1147b-x-icu | fr-FR-cp1147m-x-icu | 
| fr-FR-cp297-x-icu | fr-FR-cp297b-x-icu | – | 
| it-IT-cp1144-x-icu | it-IT-cp1144b-x-icu | it-IT-cp1144m-x-icu | 
| it-IT-cp280-x-icu | it-IT-cp280b-x-icu | – | 
| nl-BE-cp1148-x-icu | nl-BE-cp1148b-x-icu | nl-BE-cp1148m-x-icu | 
| nl-BE-cp500-x-icu | nl-BE-cp500b-x-icu | – | 

To learn more about AWS Blu Age, see [Tutorial: Managed Runtime for AWS Blu Age](https://docs.aws.amazon.com/m2/latest/userguide/tutorial-runtime-ba.html) in the *AWS Mainframe Modernization User Guide*. 

For more information about working with AWS Micro Focus, see [Tutorial: Managed Runtime for Micro Focus](https://docs.aws.amazon.com/m2/latest/userguide/tutorial-runtime.html) in the *AWS Mainframe Modernization User Guide*.

For more information about managing collations in PostgreSQL, see [Collation Support](https://www.postgresql.org/docs/current/collation.html) in the PostgreSQL documentation.

# Collations supported in Aurora PostgreSQL
<a name="PostgreSQL-Collations"></a>

Collations are set of rules that determine how character strings stored in the database are sorted and compared. Collations play a fundamental role in the computer system and are included as part of the operating system. Collations change over time when new characters are added to languages or when ordering rules change.

Collation libraries define specific rules and algorithms for a collation. The most popular collation libraries used within PostgreSQL are GNU C (glibc) and Internationalization components for Unicode (ICU). By default, Aurora PostgreSQL uses the glibc collation that includes unicode character sort orders for multi-byte character sequences.

When you create a new Aurora PostgreSQL DB cluster, it checks the operating system for the available collation. The PostgreSQL parameters of the `CREATE DATABASE` command `LC_COLLATE` and `LC_CTYPE` are used to specify a collation, which stands as the default collation in that database. Alternatively, you can also use the `LOCALE` parameter in `CREATE DATABASE` to set these parameters. This determines the default collation for character strings in the database and the rules for classifying characters as letters, numbers, or symbols. You can also choose a collation to use on a column, index, or on a query.

Aurora PostgreSQL depends on the glibc library in the operating system for collation support. Aurora PostgreSQL instance is periodically updated with the latest versions of the operating system. These updates sometimes include a newer version of the glibc library. Rarely, newer versions of glibc change the sort order or collation of some characters, which can cause the data to sort differently or produce invalid index entries. If you discover sort order issues for collation during an update, you might need to rebuild the indexes.

To reduce the possible impacts of the glibc updates, Aurora PostgreSQL now includes an independent default collation library. This collation library is available in Aurora PostgreSQL 14.6, 13.9, 12.13, 11.18 and newer minor version releases. It is compatible with glibc 2.26-59.amzn2, and provides sort order stability to prevent incorrect query results.

# Aurora PostgreSQL functions reference
<a name="Appendix.AuroraPostgreSQL.Functions"></a>

Following, you can find a list of Aurora PostgreSQL functions that are available for your Aurora DB clusters that run the Aurora PostgreSQL-Compatible Edition DB engine. These Aurora PostgreSQL functions are in addition to the standard PostgreSQL functions. For more information about standard PostgreSQL functions, see [PostgreSQL–Functions and Operators](https://www.postgresql.org/docs/current/functions.html). 

## Overview
<a name="Appendix.AuroraPostgreSQL.Functions.Overview"></a>

You can use the following functions for Amazon RDS DB instances running Aurora PostgreSQL:
+ [aurora\$1db\$1instance\$1identifier](aurora_db_instance_identifier.md)
+ [aurora\$1ccm\$1status](aurora_ccm_status.md)
+ [aurora\$1global\$1db\$1instance\$1status](aurora_global_db_instance_status.md)
+ [aurora\$1global\$1db\$1status](aurora_global_db_status.md)
+ [aurora\$1list\$1builtins](aurora_list_builtins.md)
+ [aurora\$1replica\$1status](aurora_replica_status.md)
+ [aurora\$1stat\$1activity](aurora_stat_activity.md)
+ [aurora\$1stat\$1backend\$1waits](aurora_stat_backend_waits.md)
+ [aurora\$1stat\$1bgwriter](aurora_stat_bgwriter.md)
+ [aurora\$1stat\$1database](aurora_stat_database.md)
+ [aurora\$1stat\$1dml\$1activity](aurora_stat_dml_activity.md)
+ [aurora\$1stat\$1get\$1db\$1commit\$1latency](aurora_stat_get_db_commit_latency.md)
+ [aurora\$1stat\$1logical\$1wal\$1cache](aurora_stat_logical_wal_cache.md)
+ [aurora\$1stat\$1memctx\$1usage](aurora_stat_memctx_usage.md)
+ [aurora\$1stat\$1optimized\$1reads\$1cache](aurora_stat_optimized_reads_cache.md)
+ [aurora\$1stat\$1plans](aurora_stat_plans.md)
+ [aurora\$1stat\$1reset\$1wal\$1cache](aurora_stat_reset_wal_cache.md)
+ [aurora\$1stat\$1statements](aurora_stat_statements.md)
+ [aurora\$1stat\$1system\$1waits](aurora_stat_system_waits.md)
+ [aurora\$1stat\$1wait\$1event](aurora_stat_wait_event.md)
+ [aurora\$1stat\$1wait\$1type](aurora_stat_wait_type.md)
+  [aurora\$1version](aurora_version.md) 
+ [aurora\$1volume\$1logical\$1start\$1lsn](aurora_volume_logical_start_lsn.md)
+ [aurora\$1wait\$1report](aurora_wait_report.md) 

# aurora\$1db\$1instance\$1identifier
<a name="aurora_db_instance_identifier"></a>

Reports the name of the DB instance name to which you're connected.

## Syntax
<a name="aurora_db_instance_identifier-syntax"></a>



```
aurora_db_instance_identifier()
```

## Arguments
<a name="aurora_db_instance_identifier-arguments"></a>

None

## Return type
<a name="aurora_db_instance_identifier-return-type"></a>

VARCHAR string

## Usage notes
<a name="aurora_db_instance_identifier-usage-notes"></a>

This function displays the name of Aurora PostgreSQL-Compatible Edition cluster's DB instance for your database client or application connection. 

This function is available starting with the release of Aurora PostgreSQL versions 13.7, 12.11, 11.16, 10.21 and for all other later versions. 

## Examples
<a name="aurora_db_instance_identifier-examples"></a>

The following example shows results of calling the `aurora_db_instance_identifier` function.

```
=> SELECT aurora_db_instance_identifier();
aurora_db_instance_identifier 
-------------------------------
 test-my-instance-name
```

You can join the results of this function with the `aurora_replica_status` function to obtain details about the DB instance for your connection. The [aurora\$1replica\$1status](aurora_replica_status.md) alone doesn't provide show you which DB instance you're using. The following example shows you how. 

```
=> SELECT *
    FROM aurora_replica_status() rt, 
         aurora_db_instance_identifier() di
    WHERE rt.server_id = di;
-[ RECORD 1 ]----------------------+-----------------------
server_id                          | test-my-instance-name
session_id                         | MASTER_SESSION_ID
durable_lsn                        | 88492069
highest_lsn_rcvd                   | 
current_read_lsn                   | 
cur_replay_latency_in_usec         | 
active_txns                        | 
is_current                         | t
last_transport_error               | 0
last_error_timestamp               | 
last_update_timestamp              | 2022-06-03 11:18:25+00
feedback_xmin                      | 
feedback_epoch                     | 
replica_lag_in_msec                | 
log_stream_speed_in_kib_per_second | 0
log_buffer_sequence_number         | 0
oldest_read_view_trx_id            | 
oldest_read_view_lsn               | 
pending_read_ios                   | 819
```

# aurora\$1ccm\$1status
<a name="aurora_ccm_status"></a>

Displays the status of cluster cache manager. 

## Syntax
<a name="aurora_ccm_status-syntax"></a>

 

```
aurora_ccm_status()
```

## Arguments
<a name="aurora_ccm_status-arguments"></a>

None.

## Return type
<a name="aurora_ccm_status-return-type"></a>

SETOF record with the following columns:
+ `buffers_sent_last_minute` – The number of buffers sent to the designated reader in the past minute. 
+ `buffers_found_last_minute` – The number of frequently accessed buffers identified during the past minute. 
+ `buffers_sent_last_scan` – The number of buffers sent to the designated reader during the last complete scan of the buffer cache. 
+ `buffers_found_last_scan` – The number of frequently accessed buffers sent during the last complete scan of the buffer cache. Buffers that are already cached on the designated reader aren't sent. 
+ `buffers_sent_current_scan` – The number of buffers sent during the current scan. 
+ `buffers_found_current_scan` – The number of frequently accessed buffers that were identified in the current scan. 
+ `current_scan_progress` – The number of buffers visited so far during the current scan.

## Usage notes
<a name="aurora_ccm_status-usage-notes"></a>

You can use this function to check and monitor the cluster cache management (CCM) feature. This function works only if CCM is active on your Aurora PostgreSQL DB cluster. To use this function you connect to the Write DB instance on your Aurora PostgreSQL DB cluster.

You turn on CCM for an Aurora PostgreSQL DB cluster by setting the `apg_ccm_enabled` to 1 in the cluster's custom DB cluster parameter group. To learn how, see [Configuring cluster cache management](AuroraPostgreSQL.cluster-cache-mgmt.md#AuroraPostgreSQL.cluster-cache-mgmt.Configure). 

Cluster cache management is active on an Aurora PostgreSQL DB cluster when the cluster has an Aurora Reader instance configured as follows:
+ The Aurora Reader instance uses same DB instance class type and size as the cluster's Writer instance. 
+ The Aurora Reader instance is configured as Tier-0 for the cluster. If the cluster has more than one Reader, this is its only Tier-0 Reader. 

Setting more than one Reader to Tier-0 disables CCM. When CCM is disabled, calling this function returns the following error message:

```
ERROR: Cluster Cache Manager is disabled
```

You can also the PostgreSQL pg\$1buffercache extension to analyze the buffer cache. For more information, see [pg\$1buffercache](https://www.postgresql.org/docs/current/pgbuffercache.html) in the PostgreSQL documentation. 

For more information, see [Introduction to Aurora PostgreSQL cluster cache management](https://aws.amazon.com/blogs/database/introduction-to-aurora-postgresql-cluster-cache-management/).

## Examples
<a name="aurora_ccm_status-examples"></a>

The following example shows the results of calling the `aurora_ccm_status` function. This first example shows CCM statistics.

```
=> SELECT * FROM aurora_ccm_status();
 buffers_sent_last_minute | buffers_found_last_minute | buffers_sent_last_scan | buffers_found_last_scan | buffers_sent_current_scan | buffers_found_current_scan | current_scan_progress
--------------------------+---------------------------+------------------------+-------------------------+---------------------------+----------------------------+-----------------------
                  2242000 |                   2242003 |               17920442 |                17923410 |                  14098000 |                   14100964 |              15877443
```

For more complete detail, you can use expanded display, as shown following:

```
\x
Expanded display is on.
SELECT *  FROM aurora_ccm_status();
[ RECORD 1 ]-----------------------+---------
buffers_sent_last_minute           | 2242000
buffers_found_last_minute          | 2242003
buffers_sent_last_scan             | 17920442
buffers_found_last_scan            | 17923410
buffers_sent_current_scan          | 14098000
buffers_found_current_scan         | 14100964
current_scan_progress              | 15877443
```

This example shows how to check warm rate and warm percentage.

```
=> SELECT buffers_sent_last_minute * 8/60 AS warm_rate_kbps,
100 * (1.0-buffers_sent_last_scan/buffers_found_last_scan) AS warm_percent 
FROM aurora_ccm_status ();
 warm_rate_kbps | warm_percent
----------------+--------------
 16523 |        100.0
```

# aurora\$1global\$1db\$1instance\$1status
<a name="aurora_global_db_instance_status"></a>

Displays the status of all Aurora instances, including replicas in an Aurora global DB cluster. 

## Syntax
<a name="aurora_global_db_instance_status-syntax"></a>

 

```
aurora_global_db_instance_status()
```

## Arguments
<a name="aurora_global_db_instance_status-arguments"></a>

None

## Return type
<a name="aurora_global_db_instance_status-return-type"></a>

SETOF record with the following columns:
+ `server_id` – The identifier of the DB instance. 
+ `session_id` – A unique identifier for the current session. A value of `MASTER_SESSION_ID` identifies the Writer (primary) DB instance. 
+ `aws_region` – The AWS Region in which this global DB instance runs. For a list of Regions, see [Region availability](Concepts.RegionsAndAvailabilityZones.md#Aurora.Overview.Availability). 
+ `durable_lsn` – The log sequence number (LSN) made durable in storage. A log sequence number (LSN) is a unique sequential number that identifies a record in the database transaction log. LSNs are ordered such that a larger LSN represents a later transaction.
+ `highest_lsn_rcvd` – The highest LSN received by the DB instance from the writer DB instance. 
+ `feedback_epoch` – The epoch that the DB instance uses when it generates hot standby information. A *hot standby* is a DB instance that supports connections and queries while the primary DB is in recovery or standby mode. The hot standby information includes the epoch (point in time) and other details about the DB instance that's being used as a hot standby. For more information, see [Hot Standby](https://www.postgresql.org/docs/current/hot-standby.html) in the PostgreSQL documentation. 
+ `feedback_xmin` – The minimum (oldest) active transaction ID used by the DB instance. 
+ `oldest_read_view_lsn` – The oldest LSN used by the DB instance to read from storage. 
+ `visibility_lag_in_msec` – How far this DB instance is lagging behind the writer DB instance in milliseconds.

## Usage notes
<a name="aurora_global_db_instance_status-usage-notes"></a>

This function shows replication statistics for an Aurora DB cluster. For each Aurora PostgreSQL DB instance in the cluster, the function shows a row of data that includes any cross-Region replicas in a global database configuration.

You can run this function from any instance in an Aurora PostgreSQL DB cluster or an Aurora PostgreSQL global database. The function returns details about lag for all replica instances.

To learn more about monitoring lag using this function (`aurora_global_db_instance_status`) or by using using `aurora_global_db_status`, see [Monitoring Aurora PostgreSQL-based global databases](aurora-global-database-monitoring.md#aurora-global-database-monitoring.postgres).

For more information about Aurora global databases, see [Overview of Amazon Aurora Global Database](aurora-global-database.md#aurora-global-database-overview). 

To get started with Aurora global databases, see [Getting started with Amazon Aurora Global Database](aurora-global-database-getting-started.md) or see [Amazon Aurora FAQs](https://aws.amazon.com/rds/aurora/faqs/). 

## Examples
<a name="aurora_global_db_instance_status-examples"></a>

This example shows cross-Region instance stats.

```
=> SELECT *
  FROM aurora_global_db_instance_status();
                server_id                 |              session_id              |  aws_region  | durable_lsn | highest_lsn_rcvd | feedback_epoch | feedback_xmin | oldest_read_view_lsn | visibility_lag_in_msec
------------------------------------------+--------------------------------------+--------------+-------------+------------------+----------------+---------------+----------------------+------------------------
 db-119-001-instance-01                   | MASTER_SESSION_ID                    | eu-west-1    |  2534560273 |           [NULL] |         [NULL] |        [NULL] |               [NULL] |                 [NULL]
 db-119-001-instance-02                   | 4ecff34d-d57c-409c-ba28-278b31d6fc40 | eu-west-1    |  2534560266 |       2534560273 |              0 |      19669196 |           2534560266 |                      6
 db-119-001-instance-03                   | 3e8a20fc-be86-43d5-95e5-bdf19d27ad6b | eu-west-1    |  2534560266 |       2534560273 |              0 |      19669196 |           2534560266 |                      6
 db-119-001-instance-04                   | fc1b0023-e8b4-4361-bede-2a7e926cead6 | eu-west-1    |  2534560266 |       2534560273 |              0 |      19669196 |           2534560254 |                     23
 db-119-001-instance-05                   | 30319b74-3f08-4e13-9728-e02aa1aa8649 | eu-west-1    |  2534560266 |       2534560273 |              0 |      19669196 |           2534560254 |                     23
 db-119-001-global-instance-1             | a331ffbb-d982-49ba-8973-527c96329c60 | eu-central-1 |  2534560254 |       2534560266 |              0 |      19669196 |           2534560247 |                    996
 db-119-001-global-instance-1             | e0955367-7082-43c4-b4db-70674064a9da | eu-west-2    |  2534560254 |       2534560266 |              0 |      19669196 |           2534560247 |                     14
 db-119-001-global-instance-1-eu-west-2a  | 1248dc12-d3a4-46f5-a9e2-85850491a897 | eu-west-2    |  2534560254 |       2534560266 |              0 |      19669196 |           2534560247 |                      0
```

This example shows how to check global replica lag in milliseconds. 

```
=> SELECT CASE
          WHEN 'MASTER_SESSION_ID' = session_id THEN 'Primary'
         ELSE 'Secondary'
      END AS global_role,
      aws_region,
      server_id,
      visibility_lag_in_msec
  FROM aurora_global_db_instance_status()
  ORDER BY 1, 2, 3;
   global_role |  aws_region  |                server_id                | visibility_lag_in_msec
-------------+--------------+-----------------------------------------+------------------------
 Primary     | eu-west-1    | db-119-001-instance-01                  |                 [NULL]
 Secondary   | eu-central-1 | db-119-001-global-instance-1            |                     13
 Secondary   | eu-west-1    | db-119-001-instance-02                  |                     10
 Secondary   | eu-west-1    | db-119-001-instance-03                  |                      9
 Secondary   | eu-west-1    | db-119-001-instance-04                  |                      2
 Secondary   | eu-west-1    | db-119-001-instance-05                  |                     18
 Secondary   | eu-west-2    | db-119-001-global-instance-1            |                     14
 Secondary   | eu-west-2    | db-119-001-global-instance-1-eu-west-2a |                     13
```

This example shows how to check min, max and average lag per AWS Region from the global database configuration.

```
=> SELECT 'Secondary' global_role,
       aws_region,
       min(visibility_lag_in_msec) min_lag_in_msec,
       max(visibility_lag_in_msec) max_lag_in_msec,
       round(avg(visibility_lag_in_msec),0) avg_lag_in_msec
  FROM aurora_global_db_instance_status()
 WHERE aws_region NOT IN (SELECT   aws_region
                              FROM aurora_global_db_instance_status()
                             WHERE session_id='MASTER_SESSION_ID')
                          GROUP BY aws_region
UNION ALL
SELECT  'Primary' global_role,
        aws_region,
        NULL,
        NULL,
        NULL
    FROM aurora_global_db_instance_status()
   WHERE session_id='MASTER_SESSION_ID'
ORDER BY 1, 5;
 global_role |  aws_region  | min_lag_in_msec | max_lag_in_msec | avg_lag_in_msec
------------+--------------+-----------------+-----------------+-----------------
 Primary    | eu-west-1    |          [NULL] |          [NULL] |          [NULL]
 Secondary  | eu-central-1 |             133 |             133 |             133
 Secondary  | eu-west-2    |               0 |             495 |             248
```

# aurora\$1global\$1db\$1status
<a name="aurora_global_db_status"></a>

Displays information about various aspects of Aurora global database lag, specifically, lag of the underlying Aurora storage (so called durability lag) and lag between the recovery point objective (RPO).

## Syntax
<a name="aurora_global_db_status-syntax"></a>

 

```
aurora_global_db_status()
```

## Arguments
<a name="aurora_global_db_status-arguments"></a>

None.

## Return type
<a name="aurora_global_db_status-return-type"></a>

SETOF record with the following columns:
+ `aws_region` – The AWS Region that this DB cluster is in. For a complete listing of AWS Regions by engine, see [Regions and Availability Zones](Concepts.RegionsAndAvailabilityZones.md). 
+ `highest_lsn_written` – The highest log sequence number (LSN) that currently exists on this DB cluster. A log sequence number (LSN) is a unique sequential number that identifies a record in the database transaction log. LSNs are ordered such that a larger LSN represents a later transaction. 
+ `durability_lag_in_msec` – The difference in the timestamp values between the `highest_lsn_written` on a secondary DB cluster and the `highest_lsn_written` on the primary DB cluster. A value of -1 identifies the primary DB cluster of the Aurora global database. 
+ `rpo_lag_in_msec` – The recovery point objective (RPO) lag. The RPO lag is the time it takes for the most recent user transaction COMMIT to be stored on a secondary DB cluster after it's been stored on the primary DB cluster of the Aurora global database. A value of -1 denotes the primary DB cluster (and thus, lag isn't relevant). 

  In simple terms, this metric calculates the recovery point objective for each Aurora PostgreSQL DB cluster in the Aurora global database, that is, how much data might be lost if there were an outage. As with lag, RPO is measured in time.
+ `last_lag_calculation_time` – The timestamp that specifies when values were last calculated for `durability_lag_in_msec` and `rpo_lag_in_msec`. A time value such as `1970-01-01 00:00:00+00` means this is the primary DB cluster. 
+ `feedback_epoch` – The epoch that the secondary DB cluster uses when it generates hot standby information. A *hot standby* is a DB instance that supports connections and queries while the primary DB is in recovery or standby mode. The hot standby information includes the epoch (point in time) and other details about the DB instance that's being used as a hot standby. For more information, see [Hot Standby](https://www.postgresql.org/docs/current/hot-standby.html) in the PostgreSQL documentation.
+ `feedback_xmin` – The minimum (oldest) active transaction ID used by a secondary DB cluster.

## Usage notes
<a name="aurora_global_db_status-usage-notes"></a>

All currently available Aurora PostgreSQL versions support this function. This function shows replication statistics for an Aurora global database. It shows one row for each DB cluster in an Aurora PostgreSQL global database. You can run this function from any instance in your Aurora PostgreSQL global database.

To evaluate Aurora global database replication lag, which is the visible data lag, see [aurora\$1global\$1db\$1instance\$1status](aurora_global_db_instance_status.md).

To learn more about using `aurora_global_db_status` and `aurora_global_db_instance_status` to monitor Aurora global database lag, see [Monitoring Aurora PostgreSQL-based global databases](aurora-global-database-monitoring.md#aurora-global-database-monitoring.postgres). For more information about Aurora global databases, see [Overview of Amazon Aurora Global Database](aurora-global-database.md#aurora-global-database-overview). 

## Examples
<a name="aurora_global_db_status-examples"></a>

This example shows how to display cross-region storage statistics.

```
=> SELECT CASE 
          WHEN '-1' = durability_lag_in_msec THEN 'Primary'
          ELSE 'Secondary'
       END AS global_role,
       *
  FROM aurora_global_db_status();
 global_role | aws_region | highest_lsn_written | durability_lag_in_msec | rpo_lag_in_msec | last_lag_calculation_time  | feedback_epoch | feedback_xmin
-------------+------------+---------------------+------------------------+-----------------+----------------------------+----------------+---------------
 Primary     | eu-west-1  |           131031557 |                     -1 |              -1 | 1970-01-01 00:00:00+00     |              0 |             0
 Secondary   | eu-west-2  |           131031554 |                    410 |               0 | 2021-06-01 18:59:36.124+00 |              0 |         12640
 Secondary   | eu-west-3  |           131031554 |                    410 |               0 | 2021-06-01 18:59:36.124+00 |              0 |         12640
```

# aurora\$1list\$1builtins
<a name="aurora_list_builtins"></a>

Lists all available Aurora PostgreSQL built-in functions, along with brief descriptions and function details.

## Syntax
<a name="aurora_list_builtins-syntax"></a>

 

```
aurora_list_builtins()
```

## Arguments
<a name="aurora_list_builtins-arguments"></a>

None

## Return type
<a name="aurora_list_builtins-return-type"></a>

SETOF record

## Examples
<a name="aurora_list_builtins-examples"></a>

The following example shows results from calling the `aurora_list_builtins` function.

```
=> SELECT * 
FROM aurora_list_builtins();
     
               Name                | Result data type |                   Argument data types                    | Type | Volatility |  Parallel  | Security |                             Description
-----------------------------------+------------------+----------------------------------------------------------+------+------------+------------+----------+---------------------------------------------------------------------
 aurora_version                    | text             |                                                          | func | stable     | safe       | invoker  | Amazon Aurora PostgreSQL-Compatible Edition version string
 aurora_stat_wait_type             | SETOF record     | OUT type_id smallint, OUT type_name text                 | func | volatile   | restricted | invoker  | Lists all supported wait types
 aurora_stat_wait_event            | SETOF record     | OUT type_id smallint, OUT event_id integer, OUT event_na.| func | volatile   | restricted | invoker  | Lists all supported wait events
                                   |                  |.me text                                                  |      |            |            |          |
 aurora_list_builtins              | SETOF record     | OUT "Name" text, OUT "Result data type" text, OUT "Argum.| func | stable     | safe       | invoker  | Lists all Aurora built-in functions
                                   |                  |.ent data types" text, OUT "Type" text, OUT "Volatility" .|      |            |            |          |
                                   |                  |.text, OUT "Parallel" text, OUT "Security" text, OUT "Des.|      |            |            |          |
                                   |                  |.cription" text                                           |      |            |            |          |
 .
 .
 .
 aurora_stat_file                  | SETOF record     | OUT filename text, OUT allocated_bytes bigint, OUT used_.| func | stable     | safe       | invoker  | Lists all files present in Aurora storage
                                   |                  |.bytes bigint                                             |      |            |            |          |
 aurora_stat_get_db_commit_latency | bigint           | oid                                                      | func | stable     | restricted | invoker  | Per DB commit latency in microsecs
```

# aurora\$1replica\$1status
<a name="aurora_replica_status"></a>

Displays the status of all Aurora PostgreSQL reader nodes. 

## Syntax
<a name="aurora_replica_status-syntax"></a>

 

```
aurora_replica_status()
```

## Arguments
<a name="aurora_replica_status-arguments"></a>

None

## Return type
<a name="aurora_replica_status-return-type"></a>

SETOF record with the following columns:
+ `server_id` – The DB instance ID (identifier). 
+ `session_id` – A unique identifier for the current session, returned for primary instance and reader instances as follows:
  + For the primary instance, `session_id` is always ``MASTER_SESSION_ID’`.
  + For reader instances, `session_id` is always the `UUID` (universally unique identifier) of the reader instance.
+ `durable_lsn` – The log sequence number (LSN) that's been saved in storage.
  + For the primary volume, the primary volume durable LSN (VDL) that's currently in effect.
  + For any secondary volumes, the VDL of the primary up to which the secondary has successfully been applied.
**Note**  
A log sequence number (LSN) is a unique sequential number that identifies a record in the database transaction log. LSNs are ordered such that a larger LSN represents a transaction that's occurred later in the sequence.
+ `highest_lsn_rcvd` – The highest (most recent) LSN received by the DB instance from the writer DB instance.
+ `current_read_lsn` – The LSN of the most recent snapshot that's been applied to all readers. 
+ `cur_replay_latency_in_usec` – The number of microseconds that it's expected to take to replay the log on the secondary. 
+ `active_txns` – The number of currently active transactions.
+ `is_current` – Not used.
+ `last_transport_error` – Last replication error code.
+ `last_error_timestamp` – Timestamp of last replication error.
+ `last_update_timestamp` – Timestamp of last update to replica status. From Aurora PostgreSQL 13.9, the `last_update_timestamp` value for the DB instance that you are connected to is set to `NULL`.
+ `feedback_xmin` – The hot standby feedback\$1xmin of the replica. The minimum (oldest) active transaction ID used by the DB instance.
+ `feedback_epoch` – The epoch the DB instance uses when it generates hot standby information.
+ `replica_lag_in_msec` – Time that reader instance lags behind writer instance, in milliseconds.
+ `log_stream_speed_in_kib_per_second` – The log stream throughput in kilobytes per second.
+ `log_buffer_sequence_number` – The log buffer sequence number.
+ `oldest_read_view_trx_id` – Not used.
+ `oldest_read_view_lsn` – The oldest LSN used by the DB instance to read from storage.
+ `pending_read_ios` – The outstanding page reads that are still pending on replica. 
+ `read_ios` – The total number of page reads on replica.
+ `iops` – Not used.
+ `cpu` – CPU usage of the Aurora Storage Daemon for each node in the cluster. For information about CPU usage by the instance, see [Instance-level metrics for Amazon Aurora](Aurora.AuroraMonitoring.Metrics.md#Aurora.AuroraMySQL.Monitoring.Metrics.instances).

## Usage notes
<a name="aurora_replica_status-usage-notes"></a>

All currently available Aurora PostgreSQL versions support this function. The `aurora_replica_status` function returns values from an Aurora PostgreSQL DB cluster's replica status manager. You can use this function to obtain information about the status of replication on your Aurora PostgreSQL DB cluster, including metrics for all DB instances in your Aurora DB cluster. For example, you can do the following:
+ **Get information about the type of instance (writer, reader) in the Aurora PostgreSQL DB cluster** – You can obtain this information by checking the values of the following columns: 
  + `server_id` – Contains the name of the instance that you specified when you created the instance. In some cases, such as for the primary (writer) instance, the name is typically created for you by appending *-instance-1* to the name that you create for your Aurora PostgreSQL DB cluster.
  + `session_id` – The `session_id` field indicates whether the instance is a reader or a writer. For a writer instance, `session_id` is always set to `"MASTER_SESSION_ID"`. For a reader instance, `session_id` is set to the `UUID` of the specific reader.
+ **Diagnose common replication issues, such as replica lag** – Replica lag is the time in milliseconds that the page cache of a reader instance is behind that of the writer instance. This lag occurs because Aurora clusters use asynchronous replication, as described in [Replication with Amazon Aurora](Aurora.Replication.md). It's shown in the `replica_lag_in_msec` column in the results returned by this function. Lag can also occur when a query is cancelled due to conflicts with recovery on a standby server. You can check `pg_stat_database_conflicts()` to verify that such a conflict is causing the replica lag (or not). For more information, see [The Statistics Collector](https://www.postgresql.org/docs/current/monitoring-stats.html#MONITORING-PG-STAT-DATABASE-CONFLICTS-VIEW) in the *PostgreSQL documentation*. To learn more about high availability and replication, see [Amazon Aurora FAQs](https://aws.amazon.com/rds/aurora/faqs/#High_Availability_and_Replication). 

  Amazon CloudWatch stores `replica_lag_in_msec` results over time, as the `AuroraReplicaLag` metric. For information about using CloudWatch metrics for Aurora, see [Monitoring Amazon Aurora metrics with Amazon CloudWatch](monitoring-cloudwatch.md) 

To learn more about troubleshooting Aurora read replicas and restarts, see [Why did my Amazon Aurora read replica fall behind and restart?](https://aws.amazon.com/premiumsupport/knowledge-center/aurora-read-replica-restart/) in the [AWS Support Center](https://console.aws.amazon.com/support/home#/). 

## Examples
<a name="aurora_replica_status-examples"></a>

The following example shows how to get the replication status of all instances in an Aurora PostgreSQL DB cluster:

```
=> SELECT * 
FROM aurora_replica_status();
```

The following example shows the writer instance in the `docs-lab-apg-main` Aurora PostgreSQL DB cluster: 

```
=> SELECT server_id, 
    CASE 
        WHEN 'MASTER_SESSION_ID' = session_id THEN 'writer'
        ELSE 'reader' 
    END AS instance_role
FROM aurora_replica_status() 
WHERE session_id = 'MASTER_SESSION_ID';
        server_id       | instance_role
------------------------+---------------
 db-119-001-instance-01 | writer
```

The following example example lists all reader instances in a cluster:

```
=> SELECT server_id, 
    CASE 
        WHEN 'MASTER_SESSION_ID' = session_id THEN 'writer'
        ELSE 'reader' 
    END AS instance_role
FROM aurora_replica_status() 
WHERE session_id <> 'MASTER_SESSION_ID';
        server_id       | instance_role
------------------------+---------------
db-119-001-instance-02  | reader
db-119-001-instance-03  | reader
db-119-001-instance-04  | reader
db-119-001-instance-05  | reader
(4 rows)
```

The following example lists all instances, how far each instance is lagging behind the writer, and how long since the last update: 

```
=> SELECT server_id, 
    CASE 
        WHEN 'MASTER_SESSION_ID' = session_id THEN 'writer'
        ELSE 'reader' 
    END AS instance_role,
    replica_lag_in_msec AS replica_lag_ms,
    round(extract (epoch FROM (SELECT age(clock_timestamp(), last_update_timestamp))) * 1000) AS last_update_age_ms
FROM aurora_replica_status()
ORDER BY replica_lag_in_msec NULLS FIRST;
       server_id        | instance_role | replica_lag_ms | last_update_age_ms
------------------------+---------------+----------------+--------------------
 db-124-001-instance-03 | writer        |         [NULL] |               1756
 db-124-001-instance-01 | reader        |             13 |               1756
 db-124-001-instance-02 | reader        |             13 |               1756
(3 rows)
```

# aurora\$1stat\$1activity
<a name="aurora_stat_activity"></a>

Returns one row per server process, showing information related to the current activity of that process.

## Syntax
<a name="aurora_stat_activity-syntax"></a>

 

```
aurora_stat_activity();
```

## Arguments
<a name="aurora_stat_activity-arguments"></a>

None

## Return type
<a name="aurora_stat_activity-return-type"></a>

Returns one row per server process. In additional to `pg_stat_activity` columns, the following field is added:
+ planid – plan identifier

## Usage notes
<a name="aurora_stat_activity-usage-notes"></a>

A supplementary view to `pg_stat_activity` returning the same columns with an additional `plan_id` column which shows the current query execution plan.

`aurora_compute_plan_id` must be enabled for the view to return a plan\$1id.

This function is available from Aurora PostgreSQL versions 14.10, 15.5, and for all other later versions.

## Examples
<a name="aurora_stat_activity-examples"></a>

The example query below aggregates the top load by query\$1id and plan\$1id.

```
db1=# select count(*), query_id, plan_id
db1-# from aurora_stat_activity() where state = 'active'
db1-# and pid <> pg_backend_pid()
db1-# group by query_id, plan_id
db1-# order by 1 desc;   

count |  query_id             |  plan_id 
-------+----------------------+-------------
 11    | -5471422286312252535 | -2054628807
 3     | -6907107586630739258 | -815866029
 1     | 5213711845501580017  |  300482084
(3 rows)
```

If the plan used for query\$1id changes, a new plan\$1id will be reported by aurora\$1stat\$1activity.

```
count  |  query_id            |  plan_id 
-------+----------------------+-------------
 10    | -5471422286312252535 | 1602979607
 1     | -6907107586630739258 | -1809935983
 1     | -2446282393000597155 | -207532066
(3 rows)
```

# aurora\$1stat\$1backend\$1waits
<a name="aurora_stat_backend_waits"></a>

Displays statistics for wait activity for a specific backend process. 

## Syntax
<a name="aurora_stat_backend_waits-syntax"></a>

 

```
aurora_stat_backend_waits(pid)
```

## Arguments
<a name="aurora_stat_backend_waits-arguments"></a>

`pid` – The ID for the backend process. You can obtain process IDs by using the `pg_stat_activity` view.

## Return type
<a name="aurora_stat_backend_waits-return-type"></a>

SETOF record with the following columns:
+ `type_id` – A number that denotes the type of wait event, such as `1` for a lightweight lock (`LWLock`), `3` for a lock, or `6` for a client session, to name some examples. These values become meaningful when you join the results of this function with columns from `aurora_stat_wait_type` function, as shown in the [Examples](#aurora_stat_backend_waits-examples). 
+ `event_id` – An identifying number for the wait event. Join this value with the columns from `aurora_stat_wait_event` to obtain meaningful event names. 
+ `waits` – A count of the number of waits accumulated for the specified process ID.
+ `wait_time` – Wait time in milliseconds.

## Usage notes
<a name="aurora_stat_backend_waits-usage-notes"></a>

You can use this function to analyze specific backend (session) wait events that occurred since a connection opened. To get more meaningful information about wait event names and types, you can combine this function `aurora_stat_wait_type` and `aurora_stat_wait_event`, by using JOIN as shown in the examples. 

## Examples
<a name="aurora_stat_backend_waits-examples"></a>

This example shows all waits, types, and event names for a backend process ID 3027. 

```
=> SELECT type_name, event_name, waits, wait_time
        FROM aurora_stat_backend_waits(3027)
NATURAL JOIN aurora_stat_wait_type()
NATURAL JOIN aurora_stat_wait_event();
type_name |       event_name       | waits | wait_time
-----------+------------------------+-------+------------
 LWLock    | ProcArrayLock          |     3 |         27
 LWLock    | wal_insert             |   423 |      16336
 LWLock    | buffer_content         | 11840 |    1033634
 LWLock    | lock_manager           | 23821 |    5664506
 Lock      | tuple                  | 10258 |  152280165
 Lock      | transactionid          | 78340 | 1239808783
 Client    | ClientRead             | 34072 |   17616684
 IO        | ControlFileSyncUpdate  |     2 |          0
 IO        | ControlFileWriteUpdate |     4 |         32
 IO        | RelationMapRead        |     2 |        795
 IO        | WALWrite               | 36666 |      98623
 IO        | XactSync               |  4867 |    7331963
```

This example shows current and cumulative wait types and wait events for all active sessions (`pg_stat_activity state <> 'idle'`) (but without the current session that's invoking the function (`pid <> pg_backend_pid()`).

```
=> SELECT a.pid,
             a.usename,
             a.app_name,
             a.current_wait_type,
             a.current_wait_event,
             a.current_state,
             wt.type_name AS wait_type,
             we.event_name AS wait_event,
             a.waits,
             a.wait_time
        FROM (SELECT pid,
                     usename,
                     left(application_name,16) AS app_name,
                     coalesce(wait_event_type,'CPU') AS current_wait_type,
                     coalesce(wait_event,'CPU') AS current_wait_event,
                     state AS current_state,
                     (aurora_stat_backend_waits(pid)).*
                FROM pg_stat_activity
               WHERE pid <> pg_backend_pid()
                 AND state <> 'idle') a
NATURAL JOIN aurora_stat_wait_type() wt
NATURAL JOIN aurora_stat_wait_event() we;
  pid  | usename  | app_name | current_wait_type | current_wait_event | current_state | wait_type |       wait_event       | waits | wait_time
-------+----------+----------+-------------------+--------------------+---------------+-----------+------------------------+-------+-----------
 30099 | postgres | pgbench  | Lock              | transactionid      | active        | LWLock    | wal_insert             |  1937 |     29975
 30099 | postgres | pgbench  | Lock              | transactionid      | active        | LWLock    | buffer_content         | 22903 |    760498
 30099 | postgres | pgbench  | Lock              | transactionid      | active        | LWLock    | lock_manager           | 10012 |    223207
 30099 | postgres | pgbench  | Lock              | transactionid      | active        | Lock      | tuple                  | 20315 |  63081529
 .
 .
 .
 30099 | postgres | pgbench  | Lock              | transactionid      | active        | IO        | WALWrite               | 93293 |    237440
 30099 | postgres | pgbench  | Lock              | transactionid      | active        | IO        | XactSync               | 13010 |  19525143
 30100 | postgres | pgbench  | Lock              | transactionid      | active        | LWLock    | ProcArrayLock          |     6 |        53
 30100 | postgres | pgbench  | Lock              | transactionid      | active        | LWLock    | wal_insert             |  1913 |     25450
 30100 | postgres | pgbench  | Lock              | transactionid      | active        | LWLock    | buffer_content         | 22874 |    778005
 .
 .
 .
 30109 | postgres | pgbench  | IO                | XactSync           | active        | LWLock    | ProcArrayLock          |     3 |        71
 30109 | postgres | pgbench  | IO                | XactSync           | active        | LWLock    | wal_insert             |  1940 |     27741
 30109 | postgres | pgbench  | IO                | XactSync           | active        | LWLock    | buffer_content         | 22962 |    776352
 30109 | postgres | pgbench  | IO                | XactSync           | active        | LWLock    | lock_manager           |  9879 |    218826
 30109 | postgres | pgbench  | IO                | XactSync           | active        | Lock      | tuple                  | 20401 |  63581306
 30109 | postgres | pgbench  | IO                | XactSync           | active        | Lock      | transactionid          | 50769 | 211645008
 30109 | postgres | pgbench  | IO                | XactSync           | active        | Client    | ClientRead             | 89901 |  44192439
```

This example shows current and the top three (3) cumulative wait type and wait events for all active sessions (`pg_stat_activity state <> 'idle'`) excluding current session (`pid <>pg_backend_pid()`).

```
=> SELECT top3.*
       FROM (SELECT a.pid,
                    a.usename,
                    a.app_name,
                    a.current_wait_type,
                    a.current_wait_event,
                    a.current_state,
                    wt.type_name AS wait_type,
                    we.event_name AS wait_event,
                    a.waits,
                    a.wait_time,
                    RANK() OVER (PARTITION BY pid ORDER BY a.wait_time DESC)
               FROM (SELECT pid,
                            usename,
                            left(application_name,16) AS app_name,
                            coalesce(wait_event_type,'CPU') AS current_wait_type,
                            coalesce(wait_event,'CPU') AS current_wait_event,
                            state AS current_state,
                            (aurora_stat_backend_waits(pid)).*
                       FROM pg_stat_activity
                      WHERE pid <> pg_backend_pid()
                        AND state <> 'idle') a
       NATURAL JOIN aurora_stat_wait_type() wt
       NATURAL JOIN aurora_stat_wait_event() we) top3
 WHERE RANK <=3;
  pid  | usename  | app_name | current_wait_type | current_wait_event | current_state | wait_type |   wait_event    |  waits  | wait_time  | rank
-------+----------+----------+-------------------+--------------------+---------------+-----------+-----------------+---------+------------+------
 20567 | postgres | psql     | CPU               | CPU                | active        | LWLock    | wal_insert      |   25000 |   67512003 |    1
 20567 | postgres | psql     | CPU               | CPU                | active        | IO        | WALWrite        | 3071758 |    1016961 |    2
 20567 | postgres | psql     | CPU               | CPU                | active        | IO        | BufFileWrite    |   20750 |     184559 |    3
 27743 | postgres | pgbench  | Lock              | transactionid      | active        | Lock      | transactionid   |  237350 | 1265580011 |    1
 27743 | postgres | pgbench  | Lock              | transactionid      | active        | Lock      | tuple           |   93641 |  341472318 |    2
 27743 | postgres | pgbench  | Lock              | transactionid      | active        | Client    | ClientRead      |  417556 |  204796837 |    3
 .
 .
 .
 27745 | postgres | pgbench  | IO                | XactSync           | active        | Lock      | transactionid   |  238068 | 1265816822 |    1
 27745 | postgres | pgbench  | IO                | XactSync           | active        | Lock      | tuple           |   93210 |  338312247 |    2
 27745 | postgres | pgbench  | IO                | XactSync           | active        | Client    | ClientRead      |  419157 |  207836533 |    3
 27746 | postgres | pgbench  | Lock              | transactionid      | active        | Lock      | transactionid   |  237621 | 1264528811 |    1
 27746 | postgres | pgbench  | Lock              | transactionid      | active        | Lock      | tuple           |   93563 |  339799310 |    2
 27746 | postgres | pgbench  | Lock              | transactionid      | active        | Client    | ClientRead      |  417304 |  208372727 |    3
```

# aurora\$1stat\$1bgwriter
<a name="aurora_stat_bgwriter"></a>

`aurora_stat_bgwriter` is a statistics view showing information about Optimized Reads cache writes.

## Syntax
<a name="aurora_stat_bgwriter-syntax"></a>

 

```
aurora_stat_bgwriter()
```

## Arguments
<a name="aurora_stat_bgwriter-arguments"></a>

None

## Return type
<a name="aurora_stat_bgwriter-return-type"></a>

SETOF record with all `pg_stat_bgwriter` columns and the following additional columns. For more information on `pg_stat_bgwriter` columns, see [https://www.postgresql.org/docs/current/monitoring-stats.html#MONITORING-PG-STAT-BGWRITER-VIEW](https://www.postgresql.org/docs/current/monitoring-stats.html#MONITORING-PG-STAT-BGWRITER-VIEW).

You can reset stats for this function using `pg_stat_reset_shared("bgwriter")`.
+ `orcache_blks_written` – Total number of optimized reads cache data blocks written. 
+ `orcache_blk_write_time` – If `track_io_timing` is enabled, it tracks the total time spent writing optimized reads cache data file blocks, in milliseconds. For more information, see [track\$1io\$1timing](https://www.postgresql.org/docs/current/runtime-config-statistics.html#GUC-TRACK-IO-TIMING). 

## Usage notes
<a name="aurora_stat_bgwriter-usage-notes"></a>

This function is available in the following Aurora PostgreSQL versions:
+ 15.4 and higher 15 versions
+ 14.9 and higher 14 versions

## Examples
<a name="aurora_stat_bgwriter-examples"></a>

```
=> select * from aurora_stat_bgwriter();    
-[ RECORD 1 ]-----------------+-----------
orcache_blks_written          | 246522
orcache_blk_write_time        | 339276.404
```

# aurora\$1stat\$1database
<a name="aurora_stat_database"></a>

It carries all columns of pg\$1stat\$1database and adds new columns in the end.

## Syntax
<a name="aurora_stat_database-syntax"></a>

 

```
aurora_stat_database()
```

## Arguments
<a name="aurora_stat_database-arguments"></a>

None

## Return type
<a name="aurora_stat_database-return-type"></a>

SETOF record with all `pg_stat_database` columns and the following additional columns. For more information on `pg_stat_database` columns, see [https://www.postgresql.org/docs/current/monitoring-stats.html#MONITORING-PG-STAT-DATABASE-VIEW](https://www.postgresql.org/docs/current/monitoring-stats.html#MONITORING-PG-STAT-DATABASE-VIEW).
+ `storage_blks_read` – Total number of shared blocks read from aurora storage in this database. 
+ `orcache_blks_hit` – Total number of optimized reads cache hits in this database. 
+ `local_blks_read` – Total number of local blocks read in this database. 
+ `storage_blk_read_time` – If `track_io_timing` is enabled, it tracks the total time spent reading data file blocks from aurora storage, in milliseconds, otherwise the value is zero. For more information, see [track\$1io\$1timing](https://www.postgresql.org/docs/current/runtime-config-statistics.html#GUC-TRACK-IO-TIMING). 
+ `local_blk_read_time` – If `track_io_timing` is enabled, it tracks the total time spent reading local data file blocks, in milliseconds, otherwise the value is zero. For more information, see [track\$1io\$1timing](https://www.postgresql.org/docs/current/runtime-config-statistics.html#GUC-TRACK-IO-TIMING).
+ `orcache_blk_read_time` – If `track_io_timing` is enabled, it tracks the total time spent reading data file blocks from optimized reads cache, in milliseconds, otherwise the value is zero. For more information, see [track\$1io\$1timing](https://www.postgresql.org/docs/current/runtime-config-statistics.html#GUC-TRACK-IO-TIMING). 

**Note**  
The value of `blks_read` is the sum of `storage_blks_read`, `orcache_blks_hit`, and `local_blks_read`.  
The value of `blk_read_time` is the sum of `storage_blk_read_time`, `orcache_blk_read_time`, and `local_blk_read_time`.

## Usage notes
<a name="aurora_stat_database-usage-notes"></a>

This function is available in the following Aurora PostgreSQL versions:
+ 15.4 and higher 15 versions
+ 14.9 and higher 14 versions

## Examples
<a name="aurora_stat_database-examples"></a>

The following example shows how it carries all the `pg_stat_database` columns and appends 6 new columns in the end:

```
=> select * from aurora_stat_database() where datid=14717;    
-[ RECORD 1 ]------------+------------------------------
datid                    | 14717
datname                  | postgres
numbackends              | 1
xact_commit              | 223
xact_rollback            | 4
blks_read                | 1059
blks_hit                 | 11456
tup_returned             | 27746
tup_fetched              | 5220
tup_inserted             | 165
tup_updated              | 42
tup_deleted              | 91
conflicts                | 0
temp_files               | 0
temp_bytes               | 0
deadlocks                | 0
checksum_failures        |
checksum_last_failure    |
blk_read_time            | 3358.689
blk_write_time           | 0
session_time             | 1076007.997
active_time              | 3684.371
idle_in_transaction_time | 0
sessions                 | 10
sessions_abandoned       | 0
sessions_fatal           | 0
sessions_killed          | 0
stats_reset              | 2023-01-12 20:15:17.370601+00
orcache_blks_hit         | 425
orcache_blk_read_time    | 89.934
storage_blks_read        | 623
storage_blk_read_time    | 3254.914
local_blks_read          | 0
local_blk_read_time      | 0
```

# aurora\$1stat\$1dml\$1activity
<a name="aurora_stat_dml_activity"></a>

Reports cumulative activity for each type of data manipulation language (DML) operation on a database in an Aurora PostgreSQL cluster.

## Syntax
<a name="aurora_stat_dml_activity-syntax"></a>

 

```
aurora_stat_dml_activity(database_oid)
```

## Arguments
<a name="aurora_stat_dml_activity-arguments"></a>

 *database\$1oid*   
The object ID (OID) of the database in the Aurora PostgreSQL cluster.

## Return type
<a name="aurora_stat_dml_activity-return-type"></a>

SETOF record

## Usage notes
<a name="aurora_stat_dml_activity-usage-notes"></a>

The `aurora_stat_dml_activity` function is only available with Aurora PostgreSQL release 3.1 compatible with PostgreSQL engine 11.6 and later.

Use this function on Aurora PostgreSQL clusters with a large number of databases to identify which databases have more or slower DML activity, or both.

The `aurora_stat_dml_activity` function returns the number of times the operations ran and the cumulative latency in microseconds for SELECT, INSERT, UPDATE, and DELETE operations. The report includes only successful DML operations.

You can reset this statistic by using the PostgreSQL statistics access function `pg_stat_reset`. You can check the last time this statistic was reset by using the `pg_stat_get_db_stat_reset_time` function. For more information about PostgreSQL statistics access functions, see [The Statistics Collector](https://www.postgresql.org/docs/9.1/monitoring-stats.html) in the PostgreSQL documentation.

## Examples
<a name="aurora_stat_dml_activity-examples"></a>

The following example shows how to report DML activity statistics for the connected database.

```
––Define the oid variable from connected database by using \gset
=> SELECT oid, 
          datname 
     FROM pg_database 
    WHERE datname=(select current_database()) \gset
=> SELECT * 
     FROM aurora_stat_dml_activity(:oid);
select_count | select_latency_microsecs | insert_count | insert_latency_microsecs | update_count | update_latency_microsecs | delete_count | delete_latency_microsecs
--------------+--------------------------+--------------+--------------------------+--------------+--------------------------+--------------+--------------------------
       178957 |                 66684115 |       171065 |                 28876649 |       519538 |            1454579206167 |            1 |                    53027


–– Showing the same results with expanded display on
=> SELECT * 
     FROM aurora_stat_dml_activity(:oid);
-[ RECORD 1 ]------------+--------------
select_count             | 178957
select_latency_microsecs | 66684115
insert_count             | 171065
insert_latency_microsecs | 28876649
update_count             | 519538
update_latency_microsecs | 1454579206167
delete_count             | 1
delete_latency_microsecs | 53027
```

The following example shows DML activity statistics for all databases in the Aurora PostgreSQL cluster. This cluster has two databases, `postgres` and `mydb`. The comma-separated list corresponds with the `select_count`, `select_latency_microsecs`, `insert_count`, `insert_latency_microsecs`, `update_count`, `update_latency_microsecs`, `delete_count`, and `delete_latency_microsecs` fields.

Aurora PostgreSQL creates and uses a system database named `rdsadmin` to support administrative operations such as backups, restores, health checks, replication, and so on. These DML operations have no impact on your Aurora PostgreSQL cluster.

```
=> SELECT oid, 
    datname, 
    aurora_stat_dml_activity(oid) 
    FROM pg_database;
oid  |    datname     |                    aurora_stat_dml_activity
-------+----------------+-----------------------------------------------------------------
 14006 | template0      | (,,,,,,,)
 16384 | rdsadmin       | (2346623,1211703821,4297518,817184554,0,0,0,0)
     1 | template1      | (,,,,,,,)
 14007 | postgres       | (178961,66716329,171065,28876649,519538,1454579206167,1,53027)
 16401 | mydb           | (200246,64302436,200036,107101855,600000,83659417514,0,0)
```

The following example shows DML activity statistics for all databases, organized in columns for better readability.

```
SELECT db.datname,
       BTRIM(SPLIT_PART(db.asdmla::TEXT, ',', 1), '()') AS select_count,
       BTRIM(SPLIT_PART(db.asdmla::TEXT, ',', 2), '()') AS select_latency_microsecs,
       BTRIM(SPLIT_PART(db.asdmla::TEXT, ',', 3), '()') AS insert_count,
       BTRIM(SPLIT_PART(db.asdmla::TEXT, ',', 4), '()') AS insert_latency_microsecs,
       BTRIM(SPLIT_PART(db.asdmla::TEXT, ',', 5), '()') AS update_count,
       BTRIM(SPLIT_PART(db.asdmla::TEXT, ',', 6), '()') AS update_latency_microsecs,
       BTRIM(SPLIT_PART(db.asdmla::TEXT, ',', 7), '()') AS delete_count,
       BTRIM(SPLIT_PART(db.asdmla::TEXT, ',', 8), '()') AS delete_latency_microsecs 
FROM  (SELECT datname,
              aurora_stat_dml_activity(oid) AS asdmla 
         FROM pg_database
      ) AS db;
      
    datname     | select_count | select_latency_microsecs | insert_count | insert_latency_microsecs | update_count | update_latency_microsecs | delete_count | delete_latency_microsecs
----------------+--------------+--------------------------+--------------+--------------------------+--------------+--------------------------+--------------+--------------------------
 template0      |              |                          |              |                          |              |                          |              |
 rdsadmin       | 4206523      | 2478812333               | 7009414      | 1338482258               | 0            | 0                        | 0            | 0
 template1      |              |                          |              |                          |              |                          |              |
 fault_test     | 66           | 452099                   | 0            | 0                        | 0            | 0                        | 0            | 0
 db_access_test | 1            | 5982                     | 0            | 0                        | 0            | 0                        | 0            | 0
 postgres       | 42035        | 95179203                 | 5752         | 2678832898               | 21157        | 441883182488             | 2            | 1520
 mydb           | 71           | 453514                   | 0            | 0                        | 1            | 190                      | 1            | 152
```

The following example shows the average cumulative latency (cumulative latency divided by count) for each DML operation for the database with the OID `16401`.

```
=> SELECT select_count, 
          select_latency_microsecs, 
          select_latency_microsecs/NULLIF(select_count,0) select_latency_per_exec,
          insert_count, 
          insert_latency_microsecs, 
          insert_latency_microsecs/NULLIF(insert_count,0) insert_latency_per_exec,
          update_count, 
          update_latency_microsecs, 
          update_latency_microsecs/NULLIF(update_count,0) update_latency_per_exec,
          delete_count, 
          delete_latency_microsecs, 
          delete_latency_microsecs/NULLIF(delete_count,0) delete_latency_per_exec
     FROM aurora_stat_dml_activity(16401);
-[ RECORD 1 ]------------+-------------
select_count             | 451312
select_latency_microsecs | 80205857
select_latency_per_exec  | 177
insert_count             | 451001
insert_latency_microsecs | 123667646
insert_latency_per_exec  | 274
update_count             | 1353067
update_latency_microsecs | 200900695615
update_latency_per_exec  | 148478
delete_count             | 12
delete_latency_microsecs | 448
delete_latency_per_exec  | 37
```

# aurora\$1stat\$1get\$1db\$1commit\$1latency
<a name="aurora_stat_get_db_commit_latency"></a>

Gets the cumulative commit latency in microseconds for Aurora PostgreSQL databases. *Commit latency* is measured as the time between when a client submits a commit request and when it receives the commit acknowledgement.

## Syntax
<a name="aurora_stat_get_db_commit_latency-syntax"></a>

 

```
aurora_stat_get_db_commit_latency(database_oid)
```

## Arguments
<a name="aurora_stat_get_db_commit_latency-arguments"></a>

 *database\$1oid*   
The object ID (OID) of the Aurora PostgreSQL database.

## Return type
<a name="aurora_stat_get_db_commit_latency-return-type"></a>

SETOF record

## Usage notes
<a name="aurora_stat_get_db_commit_latency-usage-notes"></a>

Amazon CloudWatch uses this function to calculate the average commit latency. For more information about Amazon CloudWatch metrics and how to troubleshoot high commit latency, see [Viewing metrics in the Amazon RDS console](USER_Monitoring.md) and [Making better decisions about Amazon RDS with Amazon CloudWatch metrics](https://aws.amazon.com/blogs/database/making-better-decisions-about-amazon-rds-with-amazon-cloudwatch-metrics/).

You can reset this statistic by using the PostgreSQL statistics access function `pg_stat_reset`. You can check the last time this statistic was reset by using the `pg_stat_get_db_stat_reset_time` function. For more information about PostgreSQL statistics access functions, see [The Statistics Collector](https://www.postgresql.org/docs/9.1/monitoring-stats.html) in the PostgreSQL documentation.

## Examples
<a name="aurora_stat_get_db_commit_latency-examples"></a>

The following example gets the cumulative commit latency for each database in the `pg_database` cluster.

```
=> SELECT oid, 
    datname, 
    aurora_stat_get_db_commit_latency(oid) 
    FROM pg_database;
     
  oid  |    datname     | aurora_stat_get_db_commit_latency
-------+----------------+-----------------------------------
 14006 | template0      |                                 0
 16384 | rdsadmin       |                         654387789
     1 | template1      |                                 0
 16401 | mydb           |                            229556
 69768 | postgres       |                             22011
```

The following example gets the cumulative commit latency for the currently connected database. Before calling the `aurora_stat_get_db_commit_latency` function, the example first uses `\gset` to define a variable for the `oid` argument and sets its value from the connected database.

```
––Get the oid value from the connected database before calling aurora_stat_get_db_commit_latency
=> SELECT oid
     FROM pg_database
    WHERE datname=(SELECT current_database()) \gset
=> SELECT * 
     FROM aurora_stat_get_db_commit_latency(:oid);
   
 aurora_stat_get_db_commit_latency
-----------------------------------
                        1424279160
```

The following example gets the cumulative commit latency for the `mydb` database in the `pg_database` cluster. Then, it resets this statistic by using the `pg_stat_reset` function and shows the results. Finally, it uses the `pg_stat_get_db_stat_reset_time` function to check the last time this statistic was reset.

```
=> SELECT oid,
    datname,
    aurora_stat_get_db_commit_latency(oid)
    FROM pg_database
    WHERE datname = 'mydb';
     
  oid  |  datname  | aurora_stat_get_db_commit_latency
-------+-----------+-----------------------------------
 16427 | mydb      |                           3320370


=> SELECT pg_stat_reset();
 pg_stat_reset
---------------

    
=> SELECT oid,
          datname,
          aurora_stat_get_db_commit_latency(oid)
     FROM pg_database
    WHERE datname = 'mydb';    
  oid  |  datname  | aurora_stat_get_db_commit_latency
-------+-----------+-----------------------------------
 16427 | mydb      |                                 6
    
    
=> SELECT * 
     FROM pg_stat_get_db_stat_reset_time(16427);
     
 pg_stat_get_db_stat_reset_time
--------------------------------
 2021-04-29 21:36:15.707399+00
```

# aurora\$1stat\$1logical\$1wal\$1cache
<a name="aurora_stat_logical_wal_cache"></a>

Shows logical write-ahead log (WAL) cache usage per slot.

## Syntax
<a name="aurora_stat_logical_wal_cache-syntax"></a>



```
SELECT * FROM aurora_stat_logical_wal_cache()
```

## Arguments
<a name="aurora_stat_logical_wal_cache-arguments"></a>

None

## Return type
<a name="aurora_stat_logical_wal_cache-return-type"></a>

SETOF record with the following columns:
+ `name` – The name of the replication slot. 
+ `active_pid` – ID of the walsender process. 
+ `cache_hit` – The total number of wal cache hits since last reset. 
+ `cache_miss` – The total number of wal cache misses since last reset. 
+ `blks_read` – The total number of wal cache read requests. 
+ `hit_rate` – The WAL cache hit rate (cache\$1hit / blks\$1read). 
+ `last_reset_timestamp` – Last time that the counter was reset. 

## Usage notes
<a name="aurora_stat_logical_wal_cache-usage-notes"></a>

This function is available for the following Aurora PostgreSQL versions.
+ 15.2 and all higher versions
+ 14.7 and higher versions
+ 13.8 and higher versions
+ 12.12 and higher versions
+ 11.17 and higher versions

## Examples
<a name="aurora_stat_logical_wal_cache-examples"></a>

The following example shows two replication slots with only one active. `aurora_stat_logical_wal_cache` function.

```
=> SELECT * 
     FROM aurora_stat_logical_wal_cache();
    name    | active_pid | cache_hit | cache_miss | blks_read | hit_rate |     last_reset_timestamp
------------+------------+-----------+------------+-----------+----------+-------------------------------
 test_slot1 |      79183 |        24 |          0 |        24 | 100.00%  | 2022-08-05 17:39:56.830635+00
 test_slot2 |            |         1 |          0 |         1 | 100.00%  | 2022-08-05 17:34:04.036795+00
(2 rows)
```

# aurora\$1stat\$1memctx\$1usage
<a name="aurora_stat_memctx_usage"></a>

Reports the memory context usage for each PostgreSQL process.

## Syntax
<a name="aurora_stat_memctx_usage-syntax"></a>

```
aurora_stat_memctx_usage()
```

## Arguments
<a name="aurora_stat_memctx_usage-arguments"></a>

None

## Return type
<a name="aurora_stat_memctx_usage-return-type"></a>

SETOF record with the following columns:
+ `pid` – The ID of the process. 
+ `name` – The name of the memory context. 
+ `allocated` – The number of bytes obtained from the underlying memory subsystem by the memory context. 
+ `used` – The number of bytes committed to clients of the memory context. 
+ `instances` – The count of currently existing contexts of this type. 

## Usage notes
<a name="aurora_stat_memctx_usage-usage-notes"></a>

This function displays the memory context usage for each PostgreSQL process. Some processes are labeled `anonymous`. The processes aren't exposed because they contain restricted keywords.

This function is available starting with the following Aurora PostgreSQL versions:
+ 15.3 and higher 15 versions
+ 14.8 and higher 14 versions
+ 13.11 and higher 13 versions
+ 12.15 and higher 12 versions
+ 11.20 and higher 11 versions

## Examples
<a name="aurora_stat_memctx_usage-examples"></a>

The following example shows the results of calling the `aurora_stat_memctx_usage` function.

```
=> SELECT * 
     FROM aurora_stat_memctx_usage();
  
    pid| name                            | allocated |   used  | instances 
-------+---------------------------------+-----------+---------+-----------
123864 | Miscellaneous                   |     19520 |   15064 |         3 
123864 | Aurora File Context             |      8192 |     616 |         1 
123864 | Aurora WAL Context              |      8192 |     296 |         1 
123864 | CacheMemoryContext              |    524288 |  422600 |         1 
123864 | Catalog tuple context           |     16384 |   13736 |         1 
123864 | ExecutorState                   |     32832 |   28304 |         1 
123864 | ExprContext                     |      8192 |    1720 |         1 
123864 | GWAL record construction        |      1024 |     832 |         1 
123864 | MdSmgr                          |      8192 |     296 |         1 
123864 | MessageContext                  |    532480 |  353832 |         1 
123864 | PortalHeapMemory                |      1024 |     488 |         1 
123864 | PortalMemory                    |      8192 |     576 |         1 
123864 | printtup                        |      8192 |     296 |         1 
123864 | RelCache hash table entries     |      8192 |    8152 |         1 
123864 | RowDescriptionContext           |      8192 |    1344 |         1 
123864 | smgr relation context           |      8192 |     296 |         1 
123864 | Table function arguments        |      8192 |     352 |         1 
123864 | TopTransactionContext           |      8192 |     632 |         1 
123864 | TransactionAbortContext         |     32768 |     296 |         1 
123864 | WAL record construction         |     50216 |   43904 |         1 
123864 | hash table                      |     65536 |   52744 |         6 
123864 | Relation metadata               |    191488 |  124240 |        87 
104992 | Miscellaneous                   |      9280 |    7728 |         3 
104992 | Aurora File Context             |      8192 |     376 |         1 
104992 | Aurora WAL Context              |      8192 |     296 |         1 
104992 ||Autovacuum Launcher             |      8192 |     296 |         1 
104992 | Autovacuum database list        |     16384 |     744 |         2 
104992 | CacheMemoryContext              |    262144 |  140288 |         1 
104992 | Catalog tuple context           |      8192 |     296 |         1 
104992 | GWAL record construction        |      1024 |     832 |         1 
104992 | MdSmgr                          |      8192 |     296 |         1 
104992 | PortalMemory                    |      8192 |     296 |         1 
104992 | RelCache hash table entries     |      8192 |     296 |         1 
104992 | smgr relation context           |      8192 |     296 |         1 
104992 | Autovacuum start worker (tmp)   |      8192 |     296 |         1 
104992 | TopTransactionContext           |     16384 |     592 |         2 
104992 | TransactionAbortContext         |     32768 |     296 |         1 
104992 | WAL record construction         |     50216 |   43904 |         1 
104992 | hash table                      |     49152 |   34024 |         4 
(39 rows)
```

Some restricted keywords will be hidden and the output will look as follows:

```
postgres=>SELECT * 
     FROM aurora_stat_memctx_usage();
   
    pid| name                            | allocated |   used  | instances 
-------+---------------------------------+-----------+---------+-----------
  5482 | anonymous                       |      8192 |     456 |         1 
  5482 | anonymous                       |      8192 |     296 |         1
```

# aurora\$1stat\$1optimized\$1reads\$1cache
<a name="aurora_stat_optimized_reads_cache"></a>

This function shows tiered cache stats.

## Syntax
<a name="aurora_stat_optimized_reads_cache-syntax"></a>

 

```
aurora_stat_optimized_reads_cache()
```

## Arguments
<a name="aurora_stat_optimized_reads_cache-arguments"></a>

None

## Return type
<a name="aurora_stat_optimized_reads_cache-return-type"></a>

SETOF record with the following columns:
+ `total_size` – Total optimized reads cache size. 
+ `used_size` – Used page size in optimized reads cache. 

## Usage notes
<a name="aurora_stat_optimized_reads_cache-usage-notes"></a>

This function is available in the following Aurora PostgreSQL versions:
+ 15.4 and higher 15 versions
+ 14.9 and higher 14 versions

## Examples
<a name="aurora_stat_optimized_reads_cache-examples"></a>

The following example shows the output on a r6gd.8xlarge instance :

```
=> select pg_size_pretty(total_size) as total_size, pg_size_pretty(used_size) 
                as used_size from aurora_stat_optimized_reads_cache();    
total_size | used_size
-----------+-----------
1054 GB    | 975 GB
```

# aurora\$1stat\$1plans
<a name="aurora_stat_plans"></a>

Returns a row for every tracked execution plan. 

## Syntax
<a name="aurora_stat_plans-syntax"></a>

 

```
aurora_stat_plans(
    showtext
)
```

## Arguments
<a name="aurora_stat_plans-arguments"></a>
+ showtext – Show the query and plan text. Valid values are NULL, true or false. True will show the query and plan text.

## Return type
<a name="aurora_stat_plans-return-type"></a>

Returns a row for each tracked plan that contains all the columns from `aurora_stat_statements` and the following additional columns.
+ planid – plan identifier
+ explain\$1plan – explain plan text
+ plan\$1type:
  + `no plan` - no plan was captured
  + `estimate` - plan captured with estimated costs
  + `actual` - plan captured with EXPLAIN ANALYZE
+ plan\$1captured\$1time – last time a plan was captured

## Usage notes
<a name="aurora_stat_plans-usage-notes"></a>

`aurora_compute_plan_id` must be enabled and `pg_stat_statements` must be in `shared_preload_libraries` for the plans to be tracked.

The number of plans available is controlled by the value set in the `pg_stat_statements.max` parameter. When `aurora_compute_plan_id` is enabled, you can track the plans up to this specified value in `aurora_stat_plans`.

This function is available from Aurora PostgreSQL versions 14.10, 15.5, and for all other later versions.

## Examples
<a name="aurora_stat_plans-examples"></a>

In the example below, the two plans that are for the query identifier -5471422286312252535 are captured and the statements statistics are tracked by the planid.

```
db1=# select calls, total_exec_time, planid, plan_captured_time, explain_plan
db1-# from aurora_stat_plans(true)
db1-# where queryid = '-5471422286312252535'   

calls    |  total_exec_time   |   planid    |      plan_captured_time       |                           explain_plan                           
---------+--------------------+-------------+-------------------------------+------------------------------------------------------------------
 1532632 |  3209846.097107853 |  1602979607 | 2023-10-31 03:27:16.925497+00 | Update on pgbench_branches                                      +
         |                    |             |                               |   ->  Bitmap Heap Scan on pgbench_branches                      +
         |                    |             |                               |         Recheck Cond: (bid = 76)                                +
         |                    |             |                               |         ->  Bitmap Index Scan on pgbench_branches_pkey          +
         |                    |             |                               |               Index Cond: (bid = 76)
   61365 | 124078.18012200127 | -2054628807 | 2023-10-31 03:20:09.85429+00  | Update on pgbench_branches                                      +
         |                    |             |                               |   ->  Index Scan using pgbench_branches_pkey on pgbench_branches+
         |                    |             |                               |         Index Cond: (bid = 17)
```

# aurora\$1stat\$1reset\$1wal\$1cache
<a name="aurora_stat_reset_wal_cache"></a>

Resets the counter for logical wal cache. 

## Syntax
<a name="aurora_stat_reset_wal_cache-syntax"></a>

To reset a specific slot

```
SELECT * FROM aurora_stat_reset_wal_cache('slot_name')
```

To reset all slots

```
SELECT * FROM aurora_stat_reset_wal_cache(NULL)
```

## Arguments
<a name="aurora_stat_reset_wal_cache-arguments"></a>

`NULL` or `slot_name`

## Return type
<a name="aurora_stat_reset_wal_cache-return-type"></a>

Status message, text string
+ Reset the logical wal cache counter – Success message. This text is returned when the function succeeds. 
+ Replication slot not found. Please try again. – Failure message. This text is returned when the function doesn't succeed.

## Usage notes
<a name="aurora_stat_reset_wal_cache-usage-notes"></a>

This function is available for the following versions.
+ Aurora PostgreSQL 14.5 and higher
+ Aurora PostgreSQL version 13.8 and higher
+ Aurora PostgreSQL version 12.12 and higher
+ Aurora PostgreSQLversion 11.17 and higher

## Examples
<a name="aurora_stat_reset_wal_cache-examples"></a>

The following example uses the `aurora_stat_reset_wal_cache` function to reset a slot named `test_results`, and then tries to reset a slot that doesn't exist.

```
=> SELECT * 
     FROM aurora_stat_reset_wal_cache('test_slot');
aurora_stat_reset_wal_cache
--------------------------------------
 Reset the logical wal cache counter.
(1 row)
=> SELECT * 
     FROM aurora_stat_reset_wal_cache('slot-not-exist');
aurora_stat_reset_wal_cache
-----------------------------------------------
 Replication slot not found. Please try again.
(1 row)
```

# aurora\$1stat\$1resource\$1usage
<a name="aurora_stat_resource_usage"></a>

Reports the real-time resource utilization which consists of backend resource metrics and cpu usage for all Aurora PostgreSQL backend processes.

## Syntax
<a name="aurora_stat_resource_usage-syntax"></a>

```
aurora_stat_resource_usage()
```

## Arguments
<a name="aurora_stat_resource_usage-arguments"></a>

None

## Return type
<a name="aurora_stat_resource_usage-return-type"></a>

SETOF record with columns:
+ pid - Process identifier
+ allocated\$1memory - Total memory allocated by process in bytes
+ used\$1memory - Actually used memory by process in bytes
+ cpu\$1usage\$1percent - CPU usage percentage of the process

## Usage notes
<a name="aurora_stat_resource_usage-usage-notes"></a>

This function displays the backend resource usage for each Aurora PostgreSQL backend process.

This function is available starting with the following Aurora PostgreSQL versions:
+ Aurora PostgreSQL 17.5 and higher 17 versions
+ Aurora PostgreSQL 16.9 and higher 16 versions
+ Aurora PostgreSQL 15.13 and higher 15 versions
+ Aurora PostgreSQL 14.18 and higher 14 versions
+ Aurora PostgreSQL 13.21 and higher 13 versions

## Examples
<a name="aurora_stat_resource_usage-examples"></a>

The following example shows the output of the `aurora_stat_resource_usage` function.

```
=> select * from aurora_stat_resource_usage();
 pid  | allocated_memory | used_memory |   cpu_usage_percent   
------+------------------+-------------+-----------------------
  666 |          1074032 |      333544 |   0.00729274882897963
  667 |           787312 |      287360 | 0.0029263928146372746
  668 |          3076776 |     1563488 |  0.006013116835953961
  684 |           803744 |      307480 |  0.002226855426881142
 2401 |          1232992 |      943144 |                     0
  647 |             8000 |         944 |   0.48853387812429855
  659 |           319344 |      243000 | 0.0004135602076683591
  663 |           262000 |      185736 |  0.008181301476644002
  664 |             9024 |        1216 |   0.10992313082653653
(9 rows)
```

# aurora\$1stat\$1statements
<a name="aurora_stat_statements"></a>

Displays all `pg_stat_statements` columns and adds more columns in the end. 

## Syntax
<a name="aurora_stat_statements-syntax"></a>

 

```
aurora_stat_statements(showtext boolean)
```

## Arguments
<a name="aurora_stat_statements-arguments"></a>

*showtext boolean*

## Return type
<a name="aurora_stat_statements-return-type"></a>

SETOF record with all `pg_stat_statements` columns and the following additional columns. For more information on `pg_stat_statements` columns, see [https://www.postgresql.org/docs/current/pgstatstatements.html](https://www.postgresql.org/docs/current/pgstatstatements.html).

You can reset stats for this function using `pg_stat_statements_reset()`.
+ `storage_blks_read` – Total number of shared blocks read from aurora storage by this statement. 
+ `orcache_blks_hit` – Total number of optimized reads cache hits by this statement. 
+ `storage_blk_read_time` – If `track_io_timing` is enabled, it tracks the total time the statement spent reading shared blocks from aurora storage, in milliseconds, otherwise the value is zero. For more information, see [track\$1io\$1timing](https://www.postgresql.org/docs/current/runtime-config-statistics.html#GUC-TRACK-IO-TIMING). 
+ `local_blk_read_time` – If `track_io_timing` is enabled, it tracks the total time the statement spent reading local blocks, in milliseconds, otherwise the value is zero. For more information, see [track\$1io\$1timing](https://www.postgresql.org/docs/current/runtime-config-statistics.html#GUC-TRACK-IO-TIMING).
+ `orcache_blk_read_time` – If `track_io_timing` is enabled, it tracks the total time the statement spent reading shared blocks from optimized reads cache, in milliseconds, otherwise the value is zero. For more information, see [track\$1io\$1timing](https://www.postgresql.org/docs/current/runtime-config-statistics.html#GUC-TRACK-IO-TIMING). 
+ `total_plan_peakmem` – Total sum of peak memory values during planning phase for all calls to this statement. To see the average peak memory during planning for the statement, divide this value by the number of calls.
+ `min_plan_peakmem` – Smallest peak memory value seen during planning across all calls to this statement.
+ `max_plan_peakmem` – Largest peak memory value during planning seen across all calls to this statement.
+ `total_exec_peakmem` – Total sum of peak memory values during execution phase for all calls to this statement. To see the average peak memory during execution for the statement, divide this value by the number of calls.
+ `min_exec_peakmem` –Smallest peak memory value, in bytes, seen during execution across all calls to this statement. 
+ `max_exec_peakmem` – Largest peak memory value, in bytes, seen during execution across all calls to this statement.

**Note**  
`total_plan_peakmen`, `min_plan_peakmem`, and `max_plan_peakmem` are only monitored when the setting `pg_stat_statements.track_planning` is turned on.

## Usage notes
<a name="aurora_stat_statements-usage-notes"></a>

To use the aurora\$1stat\$1statements() function, you must include `pg_stat_statements` extension in the `shared_preload_libraries` parameter.

This function is available in the following Aurora PostgreSQL versions:
+ 15.4 and higher 15 versions
+ 14.9 and higher 14 versions

The columns showing peak memory are available from the following versions:
+ 16.3 and higher versions
+ 15.7 and higher versions
+ 14.12 and higher versions

## Examples
<a name="aurora_stat_statements-examples"></a>

The following example shows how it carries all the pg\$1stat\$1statements columns and append 11 new columns in the end:

```
=> select * from aurora_stat_statements(true) where query like 'with window_max%';
-[ RECORD 1 ]----------+------------------------------------------------------------------------------------------------
userid                 | 16409
dbid                   | 5
toplevel               | t
queryid                | -8347523682669847482
query                  | with window_max as (select custid, max(scratch) over (order by scratch rows between $1 preceding 
and $2 following) wmax from ts) select sum(wmax), max(custid) from window_max
plans                  | 0
total_plan_time        | 0
min_plan_time          | 0
max_plan_time          | 0
mean_plan_time         | 0
stddev_plan_time       | 0
calls                  | 4
total_exec_time        | 254.105121
min_exec_time          | 57.503164000000005
max_exec_time          | 68.687418
mean_exec_time         | 63.52628025
stddev_exec_time       | 5.150765359979643
rows                   | 4
shared_blks_hit        | 200192
shared_blks_read       | 0
shared_blks_dirtied    | 0
shared_blks_written    | 0
local_blks_hit         | 0
local_blks_read        | 0
local_blks_dirtied     | 0
local_blks_written     | 0
temp_blks_read         | 0
temp_blks_written      | 0
blk_read_time          | 0
blk_write_time         | 0
temp_blk_read_time     | 0
temp_blk_write_time    | 0
wal_records            | 0
wal_fpi                | 0
wal_bytes              | 0
jit_functions          | 0
jit_generation_time    | 0
jit_inlining_count     | 0
jit_inlining_time      | 0
jit_optimization_count | 0
jit_optimization_time  | 0
jit_emission_count     | 0
jit_emission_time      | 0
storage_blks_read      | 0
orcache_blks_hit       | 0
storage_blk_read_time  | 0
local_blk_read_time    | 0
orcache_blk_read_time  | 0
total_plan_peakmem     | 0
min_plan_peakmem       | 0
max_plan_peakmem       | 0
total_exec_peakmem     | 6356224
min_exec_peakmem       | 1589056
max_exec_peakmem       | 1589056
```

# aurora\$1stat\$1system\$1waits
<a name="aurora_stat_system_waits"></a>

Reports wait event information for the Aurora PostgreSQL DB instance.

## Syntax
<a name="aurora_stat_system_waits-syntax"></a>

 

```
aurora_stat_system_waits()
```

## Arguments
<a name="aurora_stat_system_waits-arguments"></a>

None

## Return type
<a name="aurora_stat_system_waits-return-type"></a>

SETOF record

## Usage notes
<a name="aurora_stat_system_waits-usage-notes"></a>

This function returns the cumulative number of waits and cumulative wait time for each wait event generated by the DB instance that you're currently connected to.

The returned recordset includes the following fields:
+ `type_id` – The ID of the type of wait event.
+ `event_id` – The ID of the wait event.
+ `waits` – The number of times the wait event occurred.
+ `wait_time` – The total amount of time in microseconds spent waiting for this event.

Statistics returned by this function are reset when a DB instance restarts.

## Examples
<a name="aurora_stat_system_waits-examples"></a>

The following example shows results from calling the `aurora_stat_system_waits` function.

```
=> SELECT * 
    FROM aurora_stat_system_waits();    
 type_id | event_id  |   waits   |  wait_time
---------+-----------+-----------+--------------
       1 |  16777219 |        11 |        12864
       1 |  16777220 |       501 |       174473
       1 |  16777270 |     53171 |     23641847
       1 |  16777271 |        23 |       319668
       1 |  16777274 |        60 |        12759
.
.
.
      10 | 167772231 |    204596 |    790945212
      10 | 167772232 |         2 |        47729
      10 | 167772234 |         1 |          888
      10 | 167772235 |         2 |           64
```

The following example shows how you can use this function together with `aurora_stat_wait_event` and `aurora_stat_wait_type` to produce more readable results.

```
=> SELECT type_name,
             event_name,
             waits,
             wait_time
        FROM aurora_stat_system_waits()
NATURAL JOIN aurora_stat_wait_event()
NATURAL JOIN aurora_stat_wait_type();

 type_name |       event_name       |  waits   |  wait_time
-----------+------------------------+----------+--------------
 LWLock    | XidGenLock             |       11 |        12864
 LWLock    | ProcArrayLock          |      501 |       174473
 LWLock    | buffer_content         |    53171 |     23641847
 LWLock    | rdsutils               |        2 |        12764
 Lock      | tuple                  |    75686 |   2033956052
 Lock      | transactionid          |  1765147 |  47267583409
 Activity  | AutoVacuumMain         |   136868 |  56305604538
 Activity  | BgWriterHibernate      |     7486 |  55266949471
 Activity  | BgWriterMain           |     7487 |   1508909964
.
.
.
 IO        | SLRURead               |        3 |        11756
 IO        | WALWrite               | 52544463 |    388850428
 IO        | XactSync               |   187073 |    597041642
 IO        | ClogRead               |        2 |        47729
 IO        | OutboundCtrlRead       |        1 |          888
 IO        | OutboundCtrlWrite      |        2 |           64
```

# aurora\$1stat\$1wait\$1event
<a name="aurora_stat_wait_event"></a>

Lists all supported wait events for Aurora PostgreSQL. For information about Aurora PostgreSQL wait events, see [Amazon Aurora PostgreSQL wait events](AuroraPostgreSQL.Reference.Waitevents.md).

## Syntax
<a name="aurora_stat_wait_event-syntax"></a>

 

```
aurora_stat_wait_event()
```

## Arguments
<a name="aurora_stat_wait_event-arguments"></a>

None

## Return type
<a name="aurora_stat_wait_event-return-type"></a>

SETOF record with the following columns:
+ type\$1id – The ID of the type of wait event.
+ event\$1id – The ID of the wait event.
+ type\$1name – Wait type name
+ event\$1name – Wait event name

## Usage notes
<a name="aurora_stat_wait_event-usage-notes"></a>

To see event names with event types instead of IDs, use this function together with other functions such as `aurora_stat_wait_type` and `aurora_stat_system_waits`. Wait event names returned by this function are the same as those returned by the `aurora_wait_report` function.

## Examples
<a name="aurora_stat_wait_event-examples"></a>

The following example shows results from calling the `aurora_stat_wait_event` function.

```
=>  SELECT * 
    FROM aurora_stat_wait_event();
    
 type_id | event_id  |                event_name
---------+-----------+-------------------------------------------
       1 |  16777216 | <unassigned:0>
       1 |  16777217 | ShmemIndexLock
       1 |  16777218 | OidGenLock
       1 |  16777219 | XidGenLock
.
.
.
       9 | 150994945 | PgSleep
       9 | 150994946 | RecoveryApplyDelay
      10 | 167772160 | BufFileRead
      10 | 167772161 | BufFileWrite
      10 | 167772162 | ControlFileRead
.
.
.
      10 | 167772226 | WALInitWrite
      10 | 167772227 | WALRead
      10 | 167772228 | WALSync
      10 | 167772229 | WALSyncMethodAssign
      10 | 167772230 | WALWrite
      10 | 167772231 | XactSync
.
.
.
      11 | 184549377 | LsnAllocate
```

The following example joins `aurora_stat_wait_type` and `aurora_stat_wait_event` to return type names and event names for improved readability.

```
=> SELECT *
    FROM aurora_stat_wait_type() t 
    JOIN aurora_stat_wait_event() e 
      ON t.type_id = e.type_id; 

 type_id | type_name | type_id | event_id  |                event_name
---------+-----------+---------+-----------+-------------------------------------------
       1 | LWLock    |       1 |  16777216 | <unassigned:0>
       1 | LWLock    |       1 |  16777217 | ShmemIndexLock
       1 | LWLock    |       1 |  16777218 | OidGenLock
       1 | LWLock    |       1 |  16777219 | XidGenLock
       1 | LWLock    |       1 |  16777220 | ProcArrayLock
.
.
.
       3 | Lock      |       3 |  50331648 | relation
       3 | Lock      |       3 |  50331649 | extend
       3 | Lock      |       3 |  50331650 | page
       3 | Lock      |       3 |  50331651 | tuple
.
.
.
      10 | IO        |      10 | 167772214 | TimelineHistorySync
      10 | IO        |      10 | 167772215 | TimelineHistoryWrite
      10 | IO        |      10 | 167772216 | TwophaseFileRead
      10 | IO        |      10 | 167772217 | TwophaseFileSync
.
.
.
      11 | LSN       |      11 | 184549376 | LsnDurable
```

# aurora\$1stat\$1wait\$1type
<a name="aurora_stat_wait_type"></a>

Lists all supported wait types for Aurora PostgreSQL.

## Syntax
<a name="aurora_stat_wait_type-syntax"></a>

 

```
aurora_stat_wait_type()
```

## Arguments
<a name="aurora_stat_wait_type-arguments"></a>

None

## Return type
<a name="aurora_stat_wait_type-return-type"></a>

SETOF record with the following columns:
+ type\$1id – The ID of the type of wait event.
+ type\$1name – Wait type name.

## Usage notes
<a name="aurora_stat_wait_type-usage-notes"></a>

To see wait event names with wait event types instead of IDs, use this function together with other functions such as `aurora_stat_wait_event` and `aurora_stat_system_waits`. Wait type names returned by this function are the same as those returned by the `aurora_wait_report` function.

## Examples
<a name="aurora_stat_wait_type-examples"></a>

The following example shows results from calling the `aurora_stat_wait_type` function.

```
=> SELECT * 
     FROM aurora_stat_wait_type();     
 type_id | type_name
---------+-----------
       1 | LWLock
       3 | Lock
       4 | BufferPin
       5 | Activity
       6 | Client
       7 | Extension
       8 | IPC
       9 | Timeout
      10 | IO
      11 | LSN
```

# aurora\$1version
<a name="aurora_version"></a>

Returns the string value of the Amazon Aurora PostgreSQL-Compatible Edition version number. 

## Syntax
<a name="aurora_version-syntax"></a>

 

```
aurora_version()
```

## Arguments
<a name="aurora_version-arguments"></a>

None

## Return type
<a name="aurora_version-return-type"></a>

CHAR or VARCHAR string

## Usage notes
<a name="aurora_version-usage-notes"></a>

This function displays the version of the Amazon Aurora PostgreSQL-Compatible Edition database engine. The version number is returned as a string formatted as *major*.*minor*.*patch*. For more information about Aurora PostgreSQL version numbers, see [Aurora version number](AuroraPostgreSQL.Updates.md#AuroraPostgreSQL.Updates.Versions.AuroraNumber). 

You can choose when to apply minor version upgrades by setting the maintenance window for your Aurora PostgreSQL DB cluster. To learn how, see [Maintaining an Amazon Aurora DB cluster](USER_UpgradeDBInstance.Maintenance.md). 

Starting with the release of Aurora PostgreSQL versions 13.3, 12.8, 11.13, 10.18, and for all other later versions, Aurora version numbers follow PostgreSQL version numbers. For more information about all Aurora PostgreSQL releases, see [Amazon Aurora PostgreSQL updates](https://docs.aws.amazon.com/AmazonRDS/latest/AuroraPostgreSQLReleaseNotes/AuroraPostgreSQL.Updates.html) in the *Release Notes for Aurora PostgreSQL*. 

## Examples
<a name="aurora_version-examples"></a>

The following example shows the results of calling the `aurora_version` function on an Aurora PostgreSQL DB cluster running [PostgreSQL 12.7, Aurora PostgreSQL release 4.2](https://docs.aws.amazon.com/AmazonRDS/latest/AuroraPostgreSQLReleaseNotes/AuroraPostgreSQL.Updates.html#AuroraPostgreSQL.Updates.20180305.42) and then running the same function on a cluster running [Aurora PostgreSQL version 13.3](https://docs.aws.amazon.com/AmazonRDS/latest/AuroraPostgreSQLReleaseNotes/AuroraPostgreSQL.Updates.html#AuroraPostgreSQL.Updates.20180305.133X). 

```
=> SELECT * FROM aurora_version();
aurora_version
----------------
 4.2.2
SELECT * FROM aurora_version();
aurora_version
----------------
 13.3.0
```

This example shows how to use the function with various options to get more detail about the Aurora PostgreSQL version. This example has an Aurora version number that's distinct from the PostgreSQL version number.

```
=> SHOW SERVER_VERSION;
 server_version
----------------
 12.7
(1 row)

=> SELECT * FROM aurora_version();
aurora_version
----------------
 4.2.2
(1 row)
    
=> SELECT current_setting('server_version') AS "PostgreSQL Compatiblility";
PostgreSQL Compatiblility
---------------------------
 12.7
(1 row)

=> SELECT version() AS "PostgreSQL Compatiblility Full String";
PostgreSQL Compatiblility Full String
-------------------------------------------------------------------------------------------------------------
 PostgreSQL 12.7 on aarch64-unknown-linux-gnu, compiled by aarch64-unknown-linux-gnu-gcc (GCC) 7.4.0, 64-bit
(1 row) 
    
=> SELECT 'Aurora: '
    || aurora_version()
    || ' Compatible with PostgreSQL: '
    || current_setting('server_version') AS "Instance Version";
Instance Version
------------------------------------------------
 Aurora: 4.2.2 Compatible with PostgreSQL: 12.7
(1 row)
```

This next example uses the function with the same options in the previous example. This example doesn't have an Aurora version number that's distinct from the PostgreSQL version number.

```
=> SHOW SERVER_VERSION;
server_version
----------------
 13.3

=> SELECT * FROM aurora_version();
aurora_version
----------------
 13.3.0
=> SELECT current_setting('server_version') AS "PostgreSQL Compatiblility";
PostgreSQL Compatiblility
---------------------------
 13.3

=> SELECT version() AS "PostgreSQL Compatiblility Full String";
PostgreSQL Compatiblility Full String
-------------------------------------------------------------------------------------------------
 PostgreSQL 13.3 on x86_64-pc-linux-gnu, compiled by x86_64-pc-linux-gnu-gcc (GCC) 7.4.0, 64-bit
=> SELECT 'Aurora: ' 
    || aurora_version() 
    || ' Compatible with PostgreSQL: ' 
    || current_setting('server_version') AS "Instance Version";
Instance Version
-------------------------------------------------------
 Aurora: 13.3.0 Compatible with PostgreSQL: 13.3
```

# aurora\$1volume\$1logical\$1start\$1lsn
<a name="aurora_volume_logical_start_lsn"></a>

Returns the log sequence number (LSN) used for identifying the beginning of a record in the logical write-ahead log (WAL) stream of the Aurora cluster volume.

## Syntax
<a name="aurora_volume_logical_start_lsn-syntax"></a>

 

```
aurora_volume_logical_start_lsn()
```

## Arguments
<a name="aurora_volume_logical_start_lsn-arguments"></a>

None

## Return type
<a name="aurora_volume_logical_start_lsn-return-type"></a>

`pg_lsn`

## Usage notes
<a name="aurora_volume_logical_start_lsn-usage-notes"></a>

This function identifies the beginning of the record in the logical WAL stream for a given Aurora cluster volume. You can use this function while performing major version upgrade using logical replication and Aurora fast cloning to determine the LSN at which a snapshot or database clone is taken. You can then use logical replication to continuously stream the newer data recorded after the LSN and synchronize the changes from publisher to subscriber. 

For more information on using logical replication for a major version upgrade, see [Using logical replication to perform a major version upgrade for Aurora PostgreSQL](AuroraPostgreSQL.MajorVersionUpgrade.md). 

This function is available on the following versions of Aurora PostgreSQL:
+ 15.2 and higher 15 versions
+ 14.3 and higher 14 versions
+ 13.6 and higher 13 versions
+ 12.10 and higher 12 versions
+ 11.15 and higher 11 versions
+ 10.20 and higher 10 versions

## Examples
<a name="aurora_volume_logical_start_lsn-examples"></a>

You can obtain the log sequence number (LSN) using the following query:

```
postgres=> SELECT aurora_volume_logical_start_lsn();
            
aurora_volume_logical_start_lsn 
---------------
0/402E2F0
(1 row)
```

# aurora\$1wait\$1report
<a name="aurora_wait_report"></a>

This function shows wait event activity over a period of time. 

## Syntax
<a name="aurora_wait_report-syntax"></a>

 

```
aurora_wait_report([time])
```

## Arguments
<a name="aurora_wait_report-arguments"></a>

 *time (optional) *   
The time in seconds. Default is 10 seconds.

## Return type
<a name="aurora_wait_report-return-type"></a>

SETOF record with the following columns:
+ type\$1name – Wait type name
+ event\$1name – Wait event name
+ wait – Number of waits
+ wait\$1time – Wait time in milliseconds 
+ ms\$1per\$1wait – Average milliseconds by the number of an wait
+ waits\$1per\$1xact – Average waits by the number of one transaction
+ ms\$1per\$1xact – Average milliseconds by the number of transactions

## Usage notes
<a name="aurora_wait_report-usage-notes"></a>

This function is available as of Aurora PostgreSQL release 1.1 compatible with PostgreSQL 9.6.6 and higher versions.

To use this function, you need to first create the Aurora PostgreSQL `aurora_stat_utils` extension, as follows:

```
=> CREATE extension aurora_stat_utils;
CREATE EXTENSION
```

For more information about available Aurora PostgreSQL extension versions, see [Extension versions for Amazon Aurora PostgreSQL](https://docs.aws.amazon.com/AmazonRDS/latest/AuroraPostgreSQLReleaseNotes/AuroraPostgreSQL.Extensions.html) in *Release Notes for Aurora PostgreSQL*.

This function calculates the instance-level wait events by comparing two snapshots of statistics data from aurora\$1stat\$1system\$1waits() function and pg\$1stat\$1database PostgreSQL Statistics Views. 

For more information about `aurora_stat_system_waits()` and `pg_stat_database`, see [The Statistics Collector](https://www.postgresql.org/docs/current/monitoring-stats.html#PG-STAT-DATABASE-VIEW) in the *PostgreSQL documentation*.

When run, this function takes an initial snapshot, waits the number of seconds specified, and then takes a second snapshot. The function compares the two snapshots and returns the difference. This difference represents the instance's activity for that time interval. 

On the writer instance, the function also displays the number of committed transactions and TPS (transactions per second). This function returns information at the instance level and includes all databases on the instance. 

## Examples
<a name="aurora_wait_report-examples"></a>

This example shows how to create aurora\$1stat\$1utils extension to be able to use aurora\$1wait\$1report function. 

```
=> CREATE extension aurora_stat_utils;
CREATE EXTENSION
```

This example shows how to check wait report for 10 seconds. 

```
=> SELECT *
     FROM aurora_wait_report();
NOTICE:  committed 34 transactions in 10 seconds (tps 3)
 type_name |    event_name     | waits | wait_time | ms_per_wait | waits_per_xact | ms_per_xact
-----------+-------------------+-------+-----------+-------------+----------------+-------------
 Client    | ClientRead        |    26 |  30003.00 |    1153.961 |           0.76 |     882.441
 Activity  | WalWriterMain     |    50 |  10051.32 |     201.026 |           1.47 |     295.627
 Timeout   | PgSleep           |     1 |  10049.52 |   10049.516 |           0.03 |     295.574
 Activity  | BgWriterHibernate |     1 |  10048.15 |   10048.153 |           0.03 |     295.534
 Activity  | AutoVacuumMain    |    18 |   9941.66 |     552.314 |           0.53 |     292.402
 Activity  | BgWriterMain      |     1 |    201.09 |     201.085 |           0.03 |       5.914
 IO        | XactSync          |    15 |     25.34 |       1.690 |           0.44 |       0.745
 IO        | RelationMapRead   |    12 |      0.54 |       0.045 |           0.35 |       0.016
 IO        | WALWrite          |    84 |      0.21 |       0.002 |           2.47 |       0.006
 IO        | DataFileExtend    |     1 |      0.02 |       0.018 |           0.03 |       0.001
```

This example shows how to check wait report for 60 seconds. 

```
=> SELECT *
     FROM aurora_wait_report(60);
NOTICE:  committed 1544 transactions in 60 seconds (tps 25)
 type_name |       event_name       |  waits  | wait_time | ms_per_wait | waits_per_xact | ms_per_xact
-----------+------------------------+---------+-----------+-------------+----------------+-------------
 Lock      | transactionid          |    6422 | 477000.53 |      74.276 |           4.16 |     308.938
 Client    | ClientRead             |    8265 | 270752.99 |      32.759 |           5.35 |     175.358
 Activity  | CheckpointerMain       |       1 |  60100.25 |   60100.246 |           0.00 |      38.925
 Timeout   | PgSleep                |       1 |  60098.49 |   60098.493 |           0.00 |      38.924
 Activity  | WalWriterMain          |     296 |  60010.99 |     202.740 |           0.19 |      38.867
 Activity  | AutoVacuumMain         |     107 |  59827.84 |     559.139 |           0.07 |      38.749
 Activity  | BgWriterMain           |     290 |  58821.83 |     202.834 |           0.19 |      38.097
 IO        | XactSync               |    1295 |  55220.13 |      42.641 |           0.84 |      35.764
 IO        | WALWrite               | 6602259 |  47810.94 |       0.007 |        4276.07 |      30.966
 Lock      | tuple                  |     473 |  29880.67 |      63.173 |           0.31 |      19.353
 LWLock    | buffer_mapping         |     142 |   3540.13 |      24.930 |           0.09 |       2.293
 Activity  | BgWriterHibernate      |     290 |   1124.15 |       3.876 |           0.19 |       0.728
 IO        | BufFileRead            |    7615 |    618.45 |       0.081 |           4.93 |       0.401
 LWLock    | buffer_content         |      73 |    345.93 |       4.739 |           0.05 |       0.224
 LWLock    | lock_manager           |      62 |    191.44 |       3.088 |           0.04 |       0.124
 IO        | RelationMapRead        |      72 |      5.16 |       0.072 |           0.05 |       0.003
 LWLock    | ProcArrayLock          |       1 |      2.01 |       2.008 |           0.00 |       0.001
 IO        | ControlFileWriteUpdate |       2 |      0.03 |       0.013 |           0.00 |       0.000
 IO        | DataFileExtend         |       1 |      0.02 |       0.018 |           0.00 |       0.000
 IO        | ControlFileSyncUpdate  |       1 |      0.00 |       0.000 |           0.00 |       0.000
```

# Amazon Aurora PostgreSQL parameters
<a name="AuroraPostgreSQL.Reference.ParameterGroups"></a>

You manage your Amazon Aurora DB cluster in the same way that you manage Amazon RDS DB instances, by using parameters in a DB parameter group. However, Amazon Aurora differs from Amazon RDS in that an Aurora DB cluster has multiple DB instances. Some of the parameters that you use to manage your Amazon Aurora DB cluster apply to the entire cluster, while other parameters apply only to a given DB instance in the DB cluster, as follows:
+ **DB cluster parameter group** – A DB cluster parameter group contains the set of engine configuration parameters that apply throughout the Aurora DB cluster. For example, cluster cache management is a feature of an Aurora DB cluster that's controlled by the `apg_ccm_enabled` parameter which is part of the DB cluster parameter group. The DB cluster parameter group also contains default settings for the DB parameter group for the DB instances that make up the cluster. 
+ **DB parameter group** – A DB parameter group is the set of engine configuration values that apply to a specific DB instance of that engine type. The DB parameter groups for the PostgreSQL DB engine are used by an RDS for PostgreSQL DB instance and Aurora PostgreSQL DB cluster. These configuration settings apply to properties that can vary among the DB instances within an Aurora cluster, such as the sizes for memory buffers. 

You manage cluster-level parameters in DB cluster parameter groups. You manage instance-level parameters in DB parameter groups. You can manage parameters using the Amazon RDS console, the AWS CLI, or the Amazon RDS API. There are separate commands for managing cluster-level parameters and instance-level parameters.
+ To manage cluster-level parameters in a DB cluster parameter group, use the [modify-db-cluster-parameter-group](https://docs.aws.amazon.com/cli/latest/reference/rds/modify-db-cluster-parameter-group.html) AWS CLI command.
+ To manage instance-level parameters in a DB parameter group for a DB instance in a DB cluster, use the [modify-db-parameter-group](https://docs.aws.amazon.com/cli/latest/reference/rds/modify-db-parameter-group.html) AWS CLI command.

To learn more about the AWS CLI, see [Using the AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-using.html) in the *AWS Command Line Interface User Guide*.

For more information about parameter groups, see [Parameter groups for Amazon Aurora](USER_WorkingWithParamGroups.md).

## Viewing Aurora PostgreSQL DB cluster and DB parameters
<a name="AuroraPostgreSQL.Reference.ParameterGroups-viewing-parameters"></a>

You can view all available default parameter groups for RDS for PostgreSQL DB instances and for Aurora PostgreSQL DB clusters in the AWS Management Console. The default parameter groups for all DB engines and DB cluster types and versions are listed for each AWS Region. Any custom parameter groups are also listed. 

Rather than viewing in the AWS Management Console, you can also list parameters contained in DB cluster parameter groups and DB parameter groups by using the AWS CLI or the Amazon RDS API. For example, to list parameters in a DB cluster parameter group you use the [describe-db-cluster-parameters](https://docs.aws.amazon.com/cli/latest/reference/rds/describe-db-cluster-parameters.html) AWS CLI command as follows:

```
aws rds describe-db-cluster-parameters --db-cluster-parameter-group-name default.aurora-postgresql12
```

The command returns detailed JSON descriptions of each parameter. To reduce the amount of information returned, you can specify what you want by using the `--query` option. For example, you can get the parameter name, its description, and allowed values for the default Aurora PostgreSQL 12 DB cluster parameter group as follows: 

For Linux, macOS, or Unix:

```
aws rds describe-db-cluster-parameters --db-cluster-parameter-group-name default.aurora-postgresql12 \
    --query 'Parameters[].[{ParameterName:ParameterName,Description:Description,ApplyType:ApplyType,AllowedValues:AllowedValues}]'
```

For Windows:

```
aws rds describe-db-cluster-parameters --db-cluster-parameter-group-name default.aurora-postgresql12 ^
    --query "Parameters[].[{ParameterName:ParameterName,Description:Description,ApplyType:ApplyType,AllowedValues:AllowedValues}]"
```

An Aurora DB cluster parameter group includes the DB instance parameter group and default values for a given Aurora DB engine. You can get the list of DB parameters from the same default Aurora PostgreSQL default parameter group by usng the [describe-db-parameters](https://docs.aws.amazon.com/cli/latest/reference/rds/describe-db-parameters.html) AWS CLI command as shown following.

For Linux, macOS, or Unix:

```
aws rds describe-db-parameters --db-parameter-group-name default.aurora-postgresql12 \
    --query 'Parameters[].[{ParameterName:ParameterName,Description:Description,ApplyType:ApplyType,AllowedValues:AllowedValues}]'
```

For Windows:

```
aws rds describe-db-parameters --db-parameter-group-name default.aurora-postgresql12 ^
    --query "Parameters[].[{ParameterName:ParameterName,Description:Description,ApplyType:ApplyType,AllowedValues:AllowedValues}]"
```

The preceding commands return lists of parameters from the DB cluster or DB parameter group with descriptions and other details specified in the query. Following is an example response.

```
[
    [
        {
            "ParameterName": "apg_enable_batch_mode_function_execution",
            "ApplyType": "dynamic",
            "Description": "Enables batch-mode functions to process sets of rows at a time.",
            "AllowedValues": "0,1"
        }
    ],
    [
        {
            "ParameterName": "apg_enable_correlated_any_transform",
            "ApplyType": "dynamic",
            "Description": "Enables the planner to transform correlated ANY Sublink (IN/NOT IN subquery) to JOIN when possible.",
            "AllowedValues": "0,1"
        }
    ],...
```

Following are tables containing values for the default DB cluster parameter and DB parameter for Aurora PostgreSQL version 14.

## Aurora PostgreSQL cluster-level parameters
<a name="AuroraPostgreSQL.Reference.Parameters.Cluster"></a>

You can view the cluster-level parameters available for a specific Aurora PostgreSQL version using the AWS Management console, the AWS CLI, or the Amazon RDS API. For information about viewing the parameters in an Aurora PostgreSQL DB cluster parameter groups in the RDS console, see [Viewing parameter values for a DB cluster parameter groupin Amazon Aurora](USER_WorkingWithParamGroups.ViewingCluster.md).

Some cluster-level parameters aren't available in all versions and some are being deprecated. For information about viewing the parameters of a specific Aurora PostgreSQL version, see [Viewing Aurora PostgreSQL DB cluster and DB parameters](#AuroraPostgreSQL.Reference.ParameterGroups-viewing-parameters).

For example, the following table lists the parameters available in the default DB cluster parameter group for Aurora PostgreSQL version 14. If you create an Aurora PostgreSQL DB cluster without specifying your own custom DB parameter group, your DB cluster is created using the default Aurora DB cluster parameter group for the version chosen, such as `default.aurora-postgresql14`, `default.aurora-postgresql13`, and so on. 

For a listing of the DB instance parameters for this same default DB cluster parameter group, see [Aurora PostgreSQL instance-level parameters](#AuroraPostgreSQL.Reference.Parameters.Instance).


| Parameter name | Description | Default | 
| --- | --- | --- | 
| ansi\$1constraint\$1trigger\$1ordering | Change the firing order of constraint triggers to be compatible with the ANSI SQL standard. | –  | 
| ansi\$1force\$1foreign\$1key\$1checks | Ensure referential actions such as cascaded delete or cascaded update will always occur regardless of the various trigger contexts that exist for the action. | –  | 
| ansi\$1qualified\$1update\$1set\$1target | Support table and schema qualifiers in UPDATE ... SET statements. | –  | 
| apg\$1ccm\$1enabled | Enable or disable cluster cache management for the cluster. | –  | 
| apg\$1enable\$1batch\$1mode\$1function\$1execution | Enables batch-mode functions to process sets of rows at a time. | –  | 
| apg\$1enable\$1correlated\$1any\$1transform | Enables the planner to transform correlated ANY Sublink (IN/NOT IN subquery) to JOIN when possible. | –  | 
| apg\$1enable\$1function\$1migration | Enables the planner to migrate eligible scalar functions to the FROM clause. | –  | 
| apg\$1enable\$1not\$1in\$1transform | Enables the planner to transform NOT IN subquery to ANTI JOIN when possible. | –  | 
| apg\$1enable\$1remove\$1redundant\$1inner\$1joins | Enables the planner to remove redundant inner joins. | –  | 
| apg\$1enable\$1semijoin\$1push\$1down | Enables the use of semijoin filters for hash joins. | –  | 
| apg\$1plan\$1mgmt.capture\$1plan\$1baselines | Capture plan baseline mode. manual - enable plan capture for any SQL statement, off - disable plan capture, automatic - enable plan capture for for statements in pg\$1stat\$1statements that satisfy the eligibility criteria. | off  | 
| apg\$1plan\$1mgmt.max\$1databases | Sets the maximum number of databases that that may manage queries using apg\$1plan\$1mgmt. | 10  | 
| apg\$1plan\$1mgmt.max\$1plans | Sets the maximum number of plans that may be cached by apg\$1plan\$1mgmt. | 10000  | 
| apg\$1plan\$1mgmt.plan\$1retention\$1period | Maximum number of days since a plan was last\$1used before a plan will be automatically deleted. | 32  | 
| apg\$1plan\$1mgmt.unapproved\$1plan\$1execution\$1threshold | Estimated total plan cost below which an Unapproved plan will be executed. | 0  | 
| apg\$1plan\$1mgmt.use\$1plan\$1baselines | Use only approved or fixed plans for managed statements. | false  | 
| application\$1name | Sets the application name to be reported in statistics and logs. | –  | 
| array\$1nulls | Enable input of NULL elements in arrays. | –  | 
| aurora\$1compute\$1plan\$1id | Monitors query execution plans to detect the execution plans contributing to current database load and to track performance statistics of execution plans over time. For more information, see [Monitoring query execution plans for Aurora PostgreSQL](https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/AuroraPostgreSQL.Monitoring.Query.Plans.html). | on  | 
| authentication\$1timeout | (s) Sets the maximum allowed time to complete client authentication. | –  | 
| auto\$1explain.log\$1analyze | Use EXPLAIN ANALYZE for plan logging. | –  | 
| auto\$1explain.log\$1buffers | Log buffers usage. | –  | 
| auto\$1explain.log\$1format | EXPLAIN format to be used for plan logging. | –  | 
| auto\$1explain.log\$1min\$1duration | Sets the minimum execution time above which plans will be logged. | –  | 
| auto\$1explain.log\$1nested\$1statements | Log nested statements. | –  | 
| auto\$1explain.log\$1timing | Collect timing data, not just row counts. | –  | 
| auto\$1explain.log\$1triggers | Include trigger statistics in plans. | –  | 
| auto\$1explain.log\$1verbose | Use EXPLAIN VERBOSE for plan logging. | –  | 
| auto\$1explain.sample\$1rate | Fraction of queries to process. | –  | 
| autovacuum | Starts the autovacuum subprocess. | –  | 
| autovacuum\$1analyze\$1scale\$1factor | Number of tuple inserts, updates or deletes prior to analyze as a fraction of reltuples. | 0.05  | 
| autovacuum\$1analyze\$1threshold | Minimum number of tuple inserts, updates or deletes prior to analyze. | –  | 
| autovacuum\$1freeze\$1max\$1age | Age at which to autovacuum a table to prevent transaction ID wraparound. | –  | 
| autovacuum\$1max\$1workers | Sets the maximum number of simultaneously running autovacuum worker processes. | GREATEST(DBInstanceClassMemory/64371566592,3)  | 
| autovacuum\$1multixact\$1freeze\$1max\$1age | Multixact age at which to autovacuum a table to prevent multixact wraparound. | –  | 
| autovacuum\$1naptime | (s) Time to sleep between autovacuum runs. | 5  | 
| autovacuum\$1vacuum\$1cost\$1delay | (ms) Vacuum cost delay in milliseconds, for autovacuum. | 5  | 
| autovacuum\$1vacuum\$1cost\$1limit | Vacuum cost amount available before napping, for autovacuum. | GREATEST(log(DBInstanceClassMemory/21474836480)\$1600,200)  | 
| autovacuum\$1vacuum\$1insert\$1scale\$1factor | Number of tuple inserts prior to vacuum as a fraction of reltuples. | –  | 
| autovacuum\$1vacuum\$1insert\$1threshold | Minimum number of tuple inserts prior to vacuum, or -1 to disable insert vacuums. | –  | 
| autovacuum\$1vacuum\$1scale\$1factor | Number of tuple updates or deletes prior to vacuum as a fraction of reltuples. | 0.1  | 
| autovacuum\$1vacuum\$1threshold | Minimum number of tuple updates or deletes prior to vacuum. | –  | 
| autovacuum\$1work\$1mem | (kB) Sets the maximum memory to be used by each autovacuum worker process. | GREATEST(DBInstanceClassMemory/32768,131072)  | 
| babelfishpg\$1tds.default\$1server\$1name | Default Babelfish server name | Microsoft SQL Server  | 
| babelfishpg\$1tds.listen\$1addresses | Sets the host name or IP address(es) to listen TDS to. | \$1  | 
| babelfishpg\$1tds.port | Sets the TDS TCP port the server listens on. | 1433  | 
| babelfishpg\$1tds.tds\$1debug\$1log\$1level | Sets logging level in TDS, 0 disables logging | 1  | 
| babelfishpg\$1tds.tds\$1default\$1numeric\$1precision | Sets the default precision of numeric type to be sent in the TDS column metadata if the engine does not specify one. | 38  | 
| babelfishpg\$1tds.tds\$1default\$1numeric\$1scale | Sets the default scale of numeric type to be sent in the TDS column metadata if the engine does not specify one. | 8  | 
| babelfishpg\$1tds.tds\$1default\$1packet\$1size | Sets the default packet size for all the SQL Server clients being connected | 4096  | 
| babelfishpg\$1tds.tds\$1default\$1protocol\$1version | Sets a default TDS protocol version for all the clients being connected | DEFAULT  | 
| babelfishpg\$1tds.tds\$1ssl\$1encrypt | Sets the SSL Encryption option | 0  | 
| babelfishpg\$1tds.tds\$1ssl\$1max\$1protocol\$1version | Sets the maximum SSL/TLS protocol version to use for tds session. | TLSv1.2  | 
| babelfishpg\$1tds.tds\$1ssl\$1min\$1protocol\$1version | Sets the minimum SSL/TLS protocol version to use for tds session. | TLSv1.2 from Aurora PostgreSQL version 16, TLSv1 for versions older than Aurora PostgreSQL version 16  | 
| babelfishpg\$1tsql.default\$1locale | Default locale to be used for collations created by CREATE COLLATION. | en-US  | 
| babelfishpg\$1tsql.migration\$1mode | Defines if multiple user databases are supported | multi-db from Aurora PostgreSQL version 16, single-db for versions older than Aurora PostgreSQL version 16  | 
| babelfishpg\$1tsql.server\$1collation\$1name | Name of the default server collation | sql\$1latin1\$1general\$1cp1\$1ci\$1as  | 
| babelfishpg\$1tsql.version | Sets the output of @@VERSION variable | default  | 
| backend\$1flush\$1after | (8Kb) Number of pages after which previously performed writes are flushed to disk. | –  | 
| backslash\$1quote | Sets whether \$1\$1 is allowed in string literals. | –  | 
| backtrace\$1functions | Log backtrace for errors in these functions. | –  | 
| bytea\$1output | Sets the output format for bytea. | –  | 
| check\$1function\$1bodies | Check function bodies during CREATE FUNCTION. | –  | 
| client\$1connection\$1check\$1interval | Sets the time interval between checks for disconnection while running queries. | –  | 
| client\$1encoding | Sets the clients character set encoding. | UTF8  | 
| client\$1min\$1messages | Sets the message levels that are sent to the client. | –  | 
| compute\$1query\$1id | Compute query identifiers. | auto  | 
| config\$1file | Sets the servers main configuration file. | /rdsdbdata/config/postgresql.conf  | 
| constraint\$1exclusion | Enables the planner to use constraints to optimize queries. | –  | 
| cpu\$1index\$1tuple\$1cost | Sets the planners estimate of the cost of processing each index entry during an index scan. | –  | 
| cpu\$1operator\$1cost | Sets the planners estimate of the cost of processing each operator or function call. | –  | 
| cpu\$1tuple\$1cost | Sets the planners estimate of the cost of processing each tuple (row). | –  | 
| cron.database\$1name | Sets the database to store pg\$1cron metadata tables | postgres  | 
| cron.log\$1run | Log all jobs runs into the job\$1run\$1details table | on  | 
| cron.log\$1statement | Log all cron statements prior to execution. | off  | 
| cron.max\$1running\$1jobs | Maximum number of jobs that can run concurrently. | 5  | 
| cron.use\$1background\$1workers | Enables background workers for pg\$1cron | on  | 
| cursor\$1tuple\$1fraction | Sets the planners estimate of the fraction of a cursors rows that will be retrieved. | –  | 
| data\$1directory | Sets the servers data directory. | /rdsdbdata/db  | 
| datestyle | Sets the display format for date and time values. | –  | 
| db\$1user\$1namespace | Enables per-database user names. | –  | 
| deadlock\$1timeout | (ms) Sets the time to wait on a lock before checking for deadlock. | –  | 
| debug\$1pretty\$1print | Indents parse and plan tree displays. | –  | 
| debug\$1print\$1parse | Logs each querys parse tree. | –  | 
| debug\$1print\$1plan | Logs each querys execution plan. | –  | 
| debug\$1print\$1rewritten | Logs each querys rewritten parse tree. | –  | 
| default\$1statistics\$1target | Sets the default statistics target. | –  | 
| default\$1tablespace | Sets the default tablespace to create tables and indexes in. | –  | 
| default\$1toast\$1compression | Sets the default compression method for compressible values. | –  | 
| default\$1transaction\$1deferrable | Sets the default deferrable status of new transactions. | –  | 
| default\$1transaction\$1isolation | Sets the transaction isolation level of each new transaction. | –  | 
| default\$1transaction\$1read\$1only | Sets the default read-only status of new transactions. | –  | 
| effective\$1cache\$1size | (8kB) Sets the planners assumption about the size of the disk cache. | SUM(DBInstanceClassMemory/12038,-50003)  | 
| effective\$1io\$1concurrency | Number of simultaneous requests that can be handled efficiently by the disk subsystem. | –  | 
| enable\$1async\$1append | Enables the planners use of async append plans. | –  | 
| enable\$1bitmapscan | Enables the planners use of bitmap-scan plans. | –  | 
| enable\$1gathermerge | Enables the planners use of gather merge plans. | –  | 
| enable\$1hashagg | Enables the planners use of hashed aggregation plans. | –  | 
| enable\$1hashjoin | Enables the planners use of hash join plans. | –  | 
| enable\$1incremental\$1sort | Enables the planners use of incremental sort steps. | –  | 
| enable\$1indexonlyscan | Enables the planners use of index-only-scan plans. | –  | 
| enable\$1indexscan | Enables the planners use of index-scan plans. | –  | 
| enable\$1material | Enables the planners use of materialization. | –  | 
| enable\$1memoize | Enables the planners use of memoization | –  | 
| enable\$1mergejoin | Enables the planners use of merge join plans. | –  | 
| enable\$1nestloop | Enables the planners use of nested-loop join plans. | –  | 
| enable\$1parallel\$1append | Enables the planners use of parallel append plans. | –  | 
| enable\$1parallel\$1hash | Enables the planners user of parallel hash plans. | –  | 
| enable\$1partition\$1pruning | Enable plan-time and run-time partition pruning. | –  | 
| enable\$1partitionwise\$1aggregate | Enables partitionwise aggregation and grouping. | –  | 
| enable\$1partitionwise\$1join | Enables partitionwise join. | –  | 
| enable\$1seqscan | Enables the planners use of sequential-scan plans. | –  | 
| enable\$1sort | Enables the planners use of explicit sort steps. | –  | 
| enable\$1tidscan | Enables the planners use of TID scan plans. | –  | 
| escape\$1string\$1warning | Warn about backslash escapes in ordinary string literals. | –  | 
| exit\$1on\$1error | Terminate session on any error. | –  | 
| extra\$1float\$1digits | Sets the number of digits displayed for floating-point values. | –  | 
| force\$1parallel\$1mode | Forces use of parallel query facilities. | –  | 
| from\$1collapse\$1limit | Sets the FROM-list size beyond which subqueries are not collapsed. | –  | 
| geqo | Enables genetic query optimization. | –  | 
| geqo\$1effort | GEQO: effort is used to set the default for other GEQO parameters. | –  | 
| geqo\$1generations | GEQO: number of iterations of the algorithm. | –  | 
| geqo\$1pool\$1size | GEQO: number of individuals in the population. | –  | 
| geqo\$1seed | GEQO: seed for random path selection. | –  | 
| geqo\$1selection\$1bias | GEQO: selective pressure within the population. | –  | 
| geqo\$1threshold | Sets the threshold of FROM items beyond which GEQO is used. | –  | 
| gin\$1fuzzy\$1search\$1limit | Sets the maximum allowed result for exact search by GIN. | –  | 
| gin\$1pending\$1list\$1limit | (kB) Sets the maximum size of the pending list for GIN index. | –  | 
| hash\$1mem\$1multiplier | Multiple of work\$1mem to use for hash tables. | –  | 
| hba\$1file | Sets the servers hba configuration file. | /rdsdbdata/config/pg\$1hba.conf  | 
| hot\$1standby\$1feedback | Allows feedback from a hot standby to the primary that will avoid query conflicts. | on  | 
| huge\$1pages | Reduces overhead when a DB instance is working with large contiguous chunks of memory, such as that used by shared buffers. It is turned on by default for all the DB instance classes other than t3.medium,db.t3.large,db.t4g.medium,db.t4g.large instance classes.  | on  | 
| ident\$1file | Sets the servers ident configuration file. | /rdsdbdata/config/pg\$1ident.conf  | 
| idle\$1in\$1transaction\$1session\$1timeout | (ms) Sets the maximum allowed duration of any idling transaction. | 86400000  | 
| idle\$1session\$1timeout | Terminate any session that has been idle (that is, waiting for a client query), but not within an open transaction, for longer than the specified amount of time | –  | 
| intervalstyle | Sets the display format for interval values. | –  | 
| join\$1collapse\$1limit | Sets the FROM-list size beyond which JOIN constructs are not flattened. | –  | 
| krb\$1caseins\$1users  | Sets whether GSSAPI (Generic Security Service API) user names should be treated case-insensitively (true) or not. By default, this parameter is set to false, so Kerberos expects user names to be case sensitive. For more information, see [GSSAPI Authentication](https://www.postgresql.org/docs/current/gssapi-auth.html) in the PostgreSQL documentation.  | false | 
| lc\$1messages | Sets the language in which messages are displayed. | –  | 
| lc\$1monetary | Sets the locale for formatting monetary amounts. | –  | 
| lc\$1numeric | Sets the locale for formatting numbers. | –  | 
| lc\$1time | Sets the locale for formatting date and time values. | –  | 
| listen\$1addresses | Sets the host name or IP address(es) to listen to. | \$1  | 
| lo\$1compat\$1privileges | Enables backward compatibility mode for privilege checks on large objects. | 0  | 
| log\$1autovacuum\$1min\$1duration | (ms) Sets the minimum execution time above which autovacuum actions will be logged. | 10000  | 
| log\$1connections | Logs each successful connection. | –  | 
| log\$1destination | Sets the destination for server log output. | stderr  | 
| log\$1directory | Sets the destination directory for log files. | /rdsdbdata/log/error  | 
| log\$1disconnections | Logs end of a session, including duration. | –  | 
| log\$1duration | Logs the duration of each completed SQL statement. | –  | 
| log\$1error\$1verbosity | Sets the verbosity of logged messages. | –  | 
| log\$1executor\$1stats | Writes executor performance statistics to the server log. | –  | 
| log\$1file\$1mode | Sets the file permissions for log files. | 0644  | 
| log\$1filename | Sets the file name pattern for log files. | postgresql.log.%Y-%m-%d-%H%M  | 
| logging\$1collector | Start a subprocess to capture stderr output and/or csvlogs into log files. | 1  | 
| log\$1hostname | Logs the host name in the connection logs. | 0  | 
| logical\$1decoding\$1work\$1mem | (kB) This much memory can be used by each internal reorder buffer before spilling to disk. | –  | 
| log\$1line\$1prefix | Controls information prefixed to each log line. | %t:%r:%u@%d:%p]:  | 
| log\$1lock\$1waits | Logs long lock waits. | –  | 
| log\$1min\$1duration\$1sample | (ms) Sets the minimum execution time above which a sample of statements will be logged. Sampling is determined by log\$1statement\$1sample\$1rate. | –  | 
| log\$1min\$1duration\$1statement | (ms) Sets the minimum execution time above which statements will be logged. | –  | 
| log\$1min\$1error\$1statement | Causes all statements generating error at or above this level to be logged. | –  | 
| log\$1min\$1messages | Sets the message levels that are logged. | –  | 
| log\$1parameter\$1max\$1length | (B) When logging statements, limit logged parameter values to first N bytes. | –  | 
| log\$1parameter\$1max\$1length\$1on\$1error | (B) When reporting an error, limit logged parameter values to first N bytes. | –  | 
| log\$1parser\$1stats | Writes parser performance statistics to the server log. | –  | 
| log\$1planner\$1stats | Writes planner performance statistics to the server log. | –  | 
| log\$1replication\$1commands | Logs each replication command. | –  | 
| log\$1rotation\$1age | (min) Automatic log file rotation will occur after N minutes. | 60  | 
| log\$1rotation\$1size | (kB) Automatic log file rotation will occur after N kilobytes. | 100000  | 
| log\$1statement | Sets the type of statements logged. | –  | 
| log\$1statement\$1sample\$1rate | Fraction of statements exceeding log\$1min\$1duration\$1sample to be logged. | –  | 
| log\$1statement\$1stats | Writes cumulative performance statistics to the server log. | –  | 
| log\$1temp\$1files | (kB) Log the use of temporary files larger than this number of kilobytes. | –  | 
| log\$1timezone | Sets the time zone to use in log messages. | UTC  | 
| log\$1transaction\$1sample\$1rate | Set the fraction of transactions to log for new transactions. | –  | 
| log\$1truncate\$1on\$1rotation | Truncate existing log files of same name during log rotation. | 0  | 
| maintenance\$1io\$1concurrency | A variant of effective\$1io\$1concurrency that is used for maintenance work. | 1  | 
| maintenance\$1work\$1mem | (kB) Sets the maximum memory to be used for maintenance operations. | GREATEST(DBInstanceClassMemory/63963136\$11024,65536)  | 
| max\$1connections | Sets the maximum number of concurrent connections. | LEAST(DBInstanceClassMemory/9531392,5000)  | 
| max\$1files\$1per\$1process | Sets the maximum number of simultaneously open files for each server process. | –  | 
| max\$1locks\$1per\$1transaction | Sets the maximum number of locks per transaction. | 64  | 
| max\$1logical\$1replication\$1workers | Maximum number of logical replication worker processes. | –  | 
| max\$1parallel\$1maintenance\$1workers | Sets the maximum number of parallel processes per maintenance operation. | –  | 
| max\$1parallel\$1workers | Sets the maximum number of parallel workers than can be active at one time. | GREATEST(\$1DBInstanceVCPU/2,8)  | 
| max\$1parallel\$1workers\$1per\$1gather | Sets the maximum number of parallel processes per executor node. | –  | 
| max\$1pred\$1locks\$1per\$1page | Sets the maximum number of predicate-locked tuples per page. | –  | 
| max\$1pred\$1locks\$1per\$1relation | Sets the maximum number of predicate-locked pages and tuples per relation. | –  | 
| max\$1pred\$1locks\$1per\$1transaction | Sets the maximum number of predicate locks per transaction. | –  | 
| max\$1prepared\$1transactions | Sets the maximum number of simultaneously prepared transactions. | 0  | 
| max\$1replication\$1slots | Sets the maximum number of replication slots that the server can support. | 20  | 
| max\$1slot\$1wal\$1keep\$1size | (MB) Replication slots will be marked as failed, and segments released for deletion or recycling, if this much space is occupied by WAL on disk. | –  | 
| max\$1stack\$1depth | (kB) Sets the maximum stack depth, in kilobytes. | 6144  | 
| max\$1standby\$1streaming\$1delay | (ms) Sets the maximum delay before canceling queries when a hot standby server is processing streamed WAL data. | 14000  | 
| max\$1sync\$1workers\$1per\$1subscription | Maximum number of synchronization workers per subscription | 2  | 
| max\$1wal\$1senders | Sets the maximum number of simultaneously running WAL sender processes. | 10  | 
| max\$1worker\$1processes | Sets the maximum number of concurrent worker processes. | GREATEST(\$1DBInstanceVCPU\$12,8)  | 
| min\$1dynamic\$1shared\$1memory | (MB) Amount of dynamic shared memory reserved at startup. | –  | 
| min\$1parallel\$1index\$1scan\$1size | (8kB) Sets the minimum amount of index data for a parallel scan. | –  | 
| min\$1parallel\$1table\$1scan\$1size | (8kB) Sets the minimum amount of table data for a parallel scan. | –  | 
| old\$1snapshot\$1threshold | (min) Time before a snapshot is too old to read pages changed after the snapshot was taken. | –  | 
| orafce.nls\$1date\$1format | Emulate oracles date output behaviour. | –  | 
| orafce.timezone | Specify timezone used for sysdate function. | –  | 
| parallel\$1leader\$1participation | Controls whether Gather and Gather Merge also run subplans. | –  | 
| parallel\$1setup\$1cost | Sets the planners estimate of the cost of starting up worker processes for parallel query. | –  | 
| parallel\$1tuple\$1cost | Sets the planners estimate of the cost of passing each tuple (row) from worker to master backend. | –  | 
| password\$1encryption | Encrypt passwords. | –  | 
| pgaudit.log | Specifies which classes of statements will be logged by session audit logging. | –  | 
| pgaudit.log\$1catalog | Specifies that session logging should be enabled in the case where all relations in a statement are in pg\$1catalog. | –  | 
| pgaudit.log\$1level | Specifies the log level that will be used for log entries. | –  | 
| pgaudit.log\$1parameter | Specifies that audit logging should include the parameters that were passed with the statement. | –  | 
| pgaudit.log\$1relation | Specifies whether session audit logging should create a separate log entry for each relation (TABLE, VIEW, etc.) referenced in a SELECT or DML statement. | –  | 
| pgaudit.log\$1statement\$1once | Specifies whether logging will include the statement text and parameters with the first log entry for a statement/substatement combination or with every entry. | –  | 
| pgaudit.role | Specifies the master role to use for object audit logging. | –  | 
| pg\$1bigm.enable\$1recheck | It specifies whether to perform Recheck which is an internal process of full text search. | on  | 
| pg\$1bigm.gin\$1key\$1limit | It specifies the maximum number of 2-grams of the search keyword to be used for full text search. | 0  | 
| pg\$1bigm.last\$1update | It reports the last updated date of the pg\$1bigm module. | 2013.11.22  | 
| pg\$1bigm.similarity\$1limit | It specifies the minimum threshold used by the similarity search. | 0.3  | 
| pg\$1hint\$1plan.debug\$1print | Logs results of hint parsing. | –  | 
| pg\$1hint\$1plan.enable\$1hint | Force planner to use plans specified in the hint comment preceding to the query. | –  | 
| pg\$1hint\$1plan.enable\$1hint\$1table | Force planner to not get hint by using table lookups. | –  | 
| pg\$1hint\$1plan.message\$1level | Message level of debug messages. | –  | 
| pg\$1hint\$1plan.parse\$1messages | Message level of parse errors. | –  | 
| pglogical.batch\$1inserts | Batch inserts if possible | –  | 
| pglogical.conflict\$1log\$1level | Sets log level used for logging resolved conflicts. | –  | 
| pglogical.conflict\$1resolution | Sets method used for conflict resolution for resolvable conflicts. | –  | 
| pglogical.extra\$1connection\$1options | connection options to add to all peer node connections | –  | 
| pglogical.synchronous\$1commit | pglogical specific synchronous commit value | –  | 
| pglogical.use\$1spi | Use SPI instead of low-level API for applying changes | –  | 
| pgtle.clientauth\$1databases\$1to\$1skip | List of databases to skip for clientauth feature. | –  | 
| pgtle.clientauth\$1db\$1name | Controls which database is used for clientauth feature. | –  | 
| pgtle.clientauth\$1num\$1parallel\$1workers | Number of background workers used for clientauth feature. | –  | 
| pgtle.clientauth\$1users\$1to\$1skip | List of users to skip for clientauth feature. | –  | 
| pgtle.enable\$1clientauth | Enables the clientauth feature. | –  | 
| pgtle.passcheck\$1db\$1name | Sets which database is used for cluster-wide passcheck feature. | –  | 
| pg\$1prewarm.autoprewarm | Starts the autoprewarm worker. | –  | 
| pg\$1prewarm.autoprewarm\$1interval | Sets the interval between dumps of shared buffers | –  | 
| pg\$1similarity.block\$1is\$1normalized | Sets if the result value is normalized or not. | –  | 
| pg\$1similarity.block\$1threshold | Sets the threshold used by the Block similarity function. | –  | 
| pg\$1similarity.block\$1tokenizer | Sets the tokenizer for Block similarity function. | –  | 
| pg\$1similarity.cosine\$1is\$1normalized | Sets if the result value is normalized or not. | –  | 
| pg\$1similarity.cosine\$1threshold | Sets the threshold used by the Cosine similarity function. | –  | 
| pg\$1similarity.cosine\$1tokenizer | Sets the tokenizer for Cosine similarity function. | –  | 
| pg\$1similarity.dice\$1is\$1normalized | Sets if the result value is normalized or not. | –  | 
| pg\$1similarity.dice\$1threshold | Sets the threshold used by the Dice similarity measure. | –  | 
| pg\$1similarity.dice\$1tokenizer | Sets the tokenizer for Dice similarity measure. | –  | 
| pg\$1similarity.euclidean\$1is\$1normalized | Sets if the result value is normalized or not. | –  | 
| pg\$1similarity.euclidean\$1threshold | Sets the threshold used by the Euclidean similarity measure. | –  | 
| pg\$1similarity.euclidean\$1tokenizer | Sets the tokenizer for Euclidean similarity measure. | –  | 
| pg\$1similarity.hamming\$1is\$1normalized | Sets if the result value is normalized or not. | –  | 
| pg\$1similarity.hamming\$1threshold | Sets the threshold used by the Block similarity metric. | –  | 
| pg\$1similarity.jaccard\$1is\$1normalized | Sets if the result value is normalized or not. | –  | 
| pg\$1similarity.jaccard\$1threshold | Sets the threshold used by the Jaccard similarity measure. | –  | 
| pg\$1similarity.jaccard\$1tokenizer | Sets the tokenizer for Jaccard similarity measure. | –  | 
| pg\$1similarity.jaro\$1is\$1normalized | Sets if the result value is normalized or not. | –  | 
| pg\$1similarity.jaro\$1threshold | Sets the threshold used by the Jaro similarity measure. | –  | 
| pg\$1similarity.jarowinkler\$1is\$1normalized | Sets if the result value is normalized or not. | –  | 
| pg\$1similarity.jarowinkler\$1threshold | Sets the threshold used by the Jarowinkler similarity measure. | –  | 
| pg\$1similarity.levenshtein\$1is\$1normalized | Sets if the result value is normalized or not. | –  | 
| pg\$1similarity.levenshtein\$1threshold | Sets the threshold used by the Levenshtein similarity measure. | –  | 
| pg\$1similarity.matching\$1is\$1normalized | Sets if the result value is normalized or not. | –  | 
| pg\$1similarity.matching\$1threshold | Sets the threshold used by the Matching Coefficient similarity measure. | –  | 
| pg\$1similarity.matching\$1tokenizer | Sets the tokenizer for Matching Coefficient similarity measure. | –  | 
| pg\$1similarity.mongeelkan\$1is\$1normalized | Sets if the result value is normalized or not. | –  | 
| pg\$1similarity.mongeelkan\$1threshold | Sets the threshold used by the Monge-Elkan similarity measure. | –  | 
| pg\$1similarity.mongeelkan\$1tokenizer | Sets the tokenizer for Monge-Elkan similarity measure. | –  | 
| pg\$1similarity.nw\$1gap\$1penalty | Sets the gap penalty used by the Needleman-Wunsch similarity measure. | –  | 
| pg\$1similarity.nw\$1is\$1normalized | Sets if the result value is normalized or not. | –  | 
| pg\$1similarity.nw\$1threshold | Sets the threshold used by the Needleman-Wunsch similarity measure. | –  | 
| pg\$1similarity.overlap\$1is\$1normalized | Sets if the result value is normalized or not. | –  | 
| pg\$1similarity.overlap\$1threshold | Sets the threshold used by the Overlap Coefficient similarity measure. | –  | 
| pg\$1similarity.overlap\$1tokenizer | Sets the tokenizer for Overlap Coefficientsimilarity measure. | –  | 
| pg\$1similarity.qgram\$1is\$1normalized | Sets if the result value is normalized or not. | –  | 
| pg\$1similarity.qgram\$1threshold | Sets the threshold used by the Q-Gram similarity measure. | –  | 
| pg\$1similarity.qgram\$1tokenizer | Sets the tokenizer for Q-Gram measure. | –  | 
| pg\$1similarity.swg\$1is\$1normalized | Sets if the result value is normalized or not. | –  | 
| pg\$1similarity.swg\$1threshold | Sets the threshold used by the Smith-Waterman-Gotoh similarity measure. | –  | 
| pg\$1similarity.sw\$1is\$1normalized | Sets if the result value is normalized or not. | –  | 
| pg\$1similarity.sw\$1threshold | Sets the threshold used by the Smith-Waterman similarity measure. | –  | 
| pg\$1stat\$1statements.max | Sets the maximum number of statements tracked by pg\$1stat\$1statements. | –  | 
| pg\$1stat\$1statements.save | Save pg\$1stat\$1statements statistics across server shutdowns. | –  | 
| pg\$1stat\$1statements.track | Selects which statements are tracked by pg\$1stat\$1statements. | –  | 
| pg\$1stat\$1statements.track\$1planning | Selects whether planning duration is tracked by pg\$1stat\$1statements. | –  | 
| pg\$1stat\$1statements.track\$1utility | Selects whether utility commands are tracked by pg\$1stat\$1statements. | –  | 
| plan\$1cache\$1mode | Controls the planner selection of custom or generic plan. | –  | 
| port | Sets the TCP port the server listens on. | EndPointPort  | 
| postgis.gdal\$1enabled\$1drivers | Enable or disable GDAL drivers used with PostGIS in Postgres 9.3.5 and above. | ENABLE\$1ALL  | 
| quote\$1all\$1identifiers | When generating SQL fragments, quote all identifiers. | –  | 
| random\$1page\$1cost | Sets the planners estimate of the cost of a nonsequentially fetched disk page. | –  | 
| rdkit.dice\$1threshold | Lower threshold of Dice similarity. Molecules with similarity lower than threshold are not similar by \$1 operation. | –  | 
| rdkit.do\$1chiral\$1sss | Should stereochemistry be taken into account in substructure matching. If false, no stereochemistry information is used in substructure matches. | –  | 
| rdkit.tanimoto\$1threshold | Lower threshold of Tanimoto similarity. Molecules with similarity lower than threshold are not similar by % operation. | –  | 
| rds.accepted\$1password\$1auth\$1method | Force authentication for connections with password stored locally. | md5\$1scram  | 
| rds.adaptive\$1autovacuum | RDS parameter to enable/disable adaptive autovacuum. | 1  | 
| rds.babelfish\$1status | RDS parameter to enable/disable Babelfish for Aurora PostgreSQL. | off  | 
| rds.enable\$1plan\$1management | Enable or disable the apg\$1plan\$1mgmt extension. | 0  | 
| rds.extensions | List of extensions provided by RDS | address\$1standardizer, address\$1standardizer\$1data\$1us, apg\$1plan\$1mgmt, aurora\$1stat\$1utils, amcheck, autoinc, aws\$1commons, aws\$1ml, aws\$1s3, aws\$1lambda, bool\$1plperl, bloom, btree\$1gin, btree\$1gist, citext, cube, dblink, dict\$1int, dict\$1xsyn, earthdistance, fuzzystrmatch, hll, hstore, hstore\$1plperl, insert\$1username, intagg, intarray, ip4r, isn, jsonb\$1plperl, lo, log\$1fdw, ltree, moddatetime, old\$1snapshot, oracle\$1fdw, orafce, pgaudit, pgcrypto, pglogical, pgrouting, pgrowlocks, pgstattuple, pgtap, pg\$1bigm, pg\$1buffercache, pg\$1cron, pg\$1freespacemap, pg\$1hint\$1plan, pg\$1partman, pg\$1prewarm, pg\$1proctab, pg\$1repack, pg\$1similarity, pg\$1stat\$1statements, pg\$1trgm, pg\$1visibility, plcoffee, plls, plperl, plpgsql, plprofiler, pltcl, plv8, postgis, postgis\$1tiger\$1geocoder, postgis\$1raster, postgis\$1topology, postgres\$1fdw, prefix, rdkit, rds\$1tools, refint, sslinfo, tablefunc, tds\$1fdw, test\$1parser, tsm\$1system\$1rows, tsm\$1system\$1time, unaccent, uuid-ossp  | 
| rds.force\$1admin\$1logging\$1level | See log messages for RDS admin user actions in customer databases. | –  | 
| rds.force\$1autovacuum\$1logging\$1level | See log messages related to autovacuum operations. | WARNING  | 
| rds.force\$1ssl | Force SSL connections. | 0  | 
| rds.global\$1db\$1rpo | (s) Recovery point objective threshold, in seconds, that blocks user commits when it is violated.  This parameter is meant for Aurora PostgreSQL-based global databases. For a nonglobal database, leave it at the default value. For more information about using this parameter, see [Managing RPOs for Aurora PostgreSQL–based global databases](aurora-global-database-disaster-recovery.md#aurora-global-database-manage-recovery).   | –  | 
| rds.logical\$1replication | Enables logical decoding. | 0  | 
| rds.logically\$1replicate\$1unlogged\$1tables | Unlogged tables are logically replicated. | 1  | 
| rds.log\$1retention\$1period | Amazon RDS will delete PostgreSQL log that are older than N minutes. | 4320  | 
| rds.pg\$1stat\$1ramdisk\$1size | Size of the stats ramdisk in MB. A nonzero value will setup the ramdisk. This parameter is only available in Aurora PostgreSQL 14 and lower versions. | 0  | 
| rds.rds\$1superuser\$1reserved\$1connections | Sets the number of connection slots reserved for rds\$1superusers. This parameter is only available in versions 15 and earlier. For more information, see the PostgreSQL documentation [reserved connections](https://www.postgresql.org/docs/current/runtime-config-connection.html#GUC-RESERVED-CONNECTIONS).  | 2  | 
| rds.restrict\$1password\$1commands | restricts password-related commands to members of rds\$1password | –  | 
| rds.superuser\$1variables | List of superuser-only variables for which we elevate rds\$1superuser modification statements. | session\$1replication\$1role  | 
| recovery\$1init\$1sync\$1method | Sets the method for synchronizing the data directory before crash recovery. | syncfs  | 
| remove\$1temp\$1files\$1after\$1crash | Remove temporary files after backend crash. | 0  | 
| restart\$1after\$1crash | Reinitialize server after backend crash. | –  | 
| row\$1security | Enable row security. | –  | 
| search\$1path | Sets the schema search order for names that are not schema-qualified. | –  | 
| seq\$1page\$1cost | Sets the planners estimate of the cost of a sequentially fetched disk page. | –  | 
| session\$1replication\$1role | Sets the sessions behavior for triggers and rewrite rules. | –  | 
| shared\$1buffers | (8kB) Sets the number of shared memory buffers used by the server. | SUM(DBInstanceClassMemory/12038,-50003)  | 
| shared\$1preload\$1libraries | Lists shared libraries to preload into server. | pg\$1stat\$1statements  | 
| ssl | Enables SSL connections. | 1  | 
| ssl\$1ca\$1file | Location of the SSL server authority file. | /rdsdbdata/rds-metadata/ca-cert.pem  | 
| ssl\$1cert\$1file | Location of the SSL server certificate file. | /rdsdbdata/rds-metadata/server-cert.pem  | 
| ssl\$1ciphers | Sets the list of allowed TLS ciphers to be used on secure connections. | –  | 
| ssl\$1crl\$1dir | Location of the SSL certificate revocation list directory. | /rdsdbdata/rds-metadata/ssl\$1crl\$1dir/  | 
| ssl\$1key\$1file |  Location of the SSL server private key file | /rdsdbdata/rds-metadata/server-key.pem  | 
| ssl\$1max\$1protocol\$1version | Sets the maximum SSL/TLS protocol version allowed | –  | 
| ssl\$1min\$1protocol\$1version | Sets the minimum SSL/TLS protocol version allowed | TLSv1.2  | 
| standard\$1conforming\$1strings | Causes ... strings to treat backslashes literally. | –  | 
| statement\$1timeout | (ms) Sets the maximum allowed duration of any statement. | –  | 
| stats\$1temp\$1directory | Writes temporary statistics files to the specified directory. | /rdsdbdata/db/pg\$1stat\$1tmp  | 
| superuser\$1reserved\$1connections | Sets the number of connection slots reserved for superusers. | 3  | 
| synchronize\$1seqscans | Enable synchronized sequential scans. | –  | 
| synchronous\$1commit | Sets the current transactions synchronization level. | on  | 
| tcp\$1keepalives\$1count | Maximum number of TCP keepalive retransmits. | –  | 
| tcp\$1keepalives\$1idle | (s) Time between issuing TCP keepalives. | –  | 
| tcp\$1keepalives\$1interval | (s) Time between TCP keepalive retransmits. | –  | 
| temp\$1buffers | (8kB) Sets the maximum number of temporary buffers used by each session. | –  | 
| temp\$1file\$1limit | Constrains the total amount disk space in kilobytes that a given PostgreSQL process can use for temporary files, excluding space used for explicit temporary tables | -1  | 
| temp\$1tablespaces | Sets the tablespace(s) to use for temporary tables and sort files. | –  | 
| timezone | Sets the time zone for displaying and interpreting time stamps. | UTC  | 
| track\$1activities | Collects information about executing commands. | –  | 
| track\$1activity\$1query\$1size | Sets the size reserved for pg\$1stat\$1activity.current\$1query, in bytes. | 4096  | 
| track\$1commit\$1timestamp | Collects transaction commit time. | –  | 
| track\$1counts | Collects statistics on database activity. | –  | 
| track\$1functions | Collects function-level statistics on database activity. | pl  | 
| track\$1io\$1timing | Collects timing statistics on database IO activity. | 1  | 
| track\$1wal\$1io\$1timing | Collects timing statistics for WAL I/O activity. | –  | 
| transform\$1null\$1equals | Treats expr=NULL as expr IS NULL. | –  | 
| update\$1process\$1title | Updates the process title to show the active SQL command. | –  | 
| vacuum\$1cost\$1delay | (ms) Vacuum cost delay in milliseconds. | –  | 
| vacuum\$1cost\$1limit | Vacuum cost amount available before napping. | –  | 
| vacuum\$1cost\$1page\$1dirty | Vacuum cost for a page dirtied by vacuum. | –  | 
| vacuum\$1cost\$1page\$1hit | Vacuum cost for a page found in the buffer cache. | –  | 
| vacuum\$1cost\$1page\$1miss | Vacuum cost for a page not found in the buffer cache. | 0  | 
| vacuum\$1defer\$1cleanup\$1age | Number of transactions by which VACUUM and HOT cleanup should be deferred, if any. | –  | 
| vacuum\$1failsafe\$1age | Age at which VACUUM should trigger failsafe to avoid a wraparound outage. | 1200000000  | 
| vacuum\$1freeze\$1min\$1age | Minimum age at which VACUUM should freeze a table row. | –  | 
| vacuum\$1freeze\$1table\$1age | Age at which VACUUM should scan whole table to freeze tuples. | –  | 
| vacuum\$1multixact\$1failsafe\$1age | Multixact age at which VACUUM should trigger failsafe to avoid a wraparound outage. | 1200000000  | 
| vacuum\$1multixact\$1freeze\$1min\$1age | Minimum age at which VACUUM should freeze a MultiXactId in a table row. | –  | 
| vacuum\$1multixact\$1freeze\$1table\$1age | Multixact age at which VACUUM should scan whole table to freeze tuples. | –  | 
| wal\$1buffers | (8kB) Sets the number of disk-page buffers in shared memory for WAL. | –  | 
| wal\$1receiver\$1create\$1temp\$1slot | Sets whether a WAL receiver should create a temporary replication slot if no permanent slot is configured. | 0  | 
| wal\$1receiver\$1status\$1interval | (s) Sets the maximum interval between WAL receiver status reports to the primary. | –  | 
| wal\$1receiver\$1timeout | (ms) Sets the maximum wait time to receive data from the primary. | 30000  | 
| wal\$1sender\$1timeout | (ms) Sets the maximum time to wait for WAL replication. | –  | 
| work\$1mem | (kB) Sets the maximum memory to be used for query workspaces. | –  | 
| xmlbinary | Sets how binary values are to be encoded in XML. | –  | 
| xmloption | Sets whether XML data in implicit parsing and serialization operations is to be considered as documents or content fragments. | – | 

## Aurora PostgreSQL instance-level parameters
<a name="AuroraPostgreSQL.Reference.Parameters.Instance"></a>

You can view the instance-level parameters available for a specific Aurora PostgreSQL version using the AWS Management console, the AWS CLI, or the Amazon RDS API. For information about viewing the parameters in an Aurora PostgreSQL DB parameter groups in the RDS console, see [Viewing parameter values for a DB parameter group in Amazon Aurora](USER_WorkingWithParamGroups.Viewing.md). 

Some instance-level parameters aren't available in all versions and some are being deprecated. For information about viewing the parameters of a specific Aurora PostgreSQL version, see [Viewing Aurora PostgreSQL DB cluster and DB parameters](#AuroraPostgreSQL.Reference.ParameterGroups-viewing-parameters).

For example, the following table lists the parameters that apply to a specific DB instance in an Aurora PostgreSQL DB cluster. This list was generated by running the [describe-db-parameters](https://docs.aws.amazon.com/cli/latest/reference/rds/describe-db-parameters.html) AWS CLI command with `default.aurora-postgresql14` for the `--db-parameter-group-name` value. 

For a listing of the DB cluster parameters for this same default DB parameter group, see [Aurora PostgreSQL cluster-level parameters](#AuroraPostgreSQL.Reference.Parameters.Cluster).


| Parameter name | Description | Default | 
| --- | --- | --- | 
| apg\$1enable\$1batch\$1mode\$1function\$1execution | Enables batch-mode functions to process sets of rows at a time. | –  | 
| apg\$1enable\$1correlated\$1any\$1transform | Enables the planner to transform correlated ANY Sublink (IN/NOT IN subquery to JOIN when possible. | –  | 
| apg\$1enable\$1function\$1migration | Enables the planner to migrate eligible scalar functions to the FROM clause. | –  | 
| apg\$1enable\$1not\$1in\$1transform | Enables the planner to transform NOT IN subquery to ANTI JOIN when possible. | –  | 
| apg\$1enable\$1remove\$1redundant\$1inner\$1joins | Enables the planner to remove redundant inner joins. | –  | 
| apg\$1enable\$1semijoin\$1push\$1down | Enables the use of semijoin filters for hash joins. | –  | 
| apg\$1plan\$1mgmt.capture\$1plan\$1baselines | Capture plan baseline mode. manual - enable plan capture for any SQL statement, off - disable plan capture, automatic - enable plan capture for for statements in pg\$1stat\$1statements that satisfy the eligibility criteria. | off  | 
| apg\$1plan\$1mgmt.max\$1databases | Sets the maximum number of databases that that may manage queries using apg\$1plan\$1mgmt. | 10  | 
| apg\$1plan\$1mgmt.max\$1plans | Sets the maximum number of plans that may be cached by apg\$1plan\$1mgmt. | 10000  | 
| apg\$1plan\$1mgmt.plan\$1retention\$1period | Maximum number of days since a plan was last\$1used before a plan will be automatically deleted. | 32  | 
| apg\$1plan\$1mgmt.unapproved\$1plan\$1execution\$1threshold | Estimated total plan cost below which an Unapproved plan will be executed. | 0  | 
| apg\$1plan\$1mgmt.use\$1plan\$1baselines | Use only approved or fixed plans for managed statements. | false  | 
| application\$1name | Sets the application name to be reported in statistics and logs. | –  | 
| aurora\$1compute\$1plan\$1id | Monitors query execution plans to detect the execution plans contributing to current database load and to track performance statistics of execution plans over time. For more information, see [Monitoring query execution plans for Aurora PostgreSQL](https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/AuroraPostgreSQL.Monitoring.Query.Plans.html). | on  | 
| aurora\$1temp\$1space\$1size | (MB) Sets size of the allocated space for Optimized Reads-enabled temporary objects on Aurora I/O-Optimized clusters with supported instance classes. | DBInstanceClassMemory/524288 | 
| authentication\$1timeout | (s Sets the maximum allowed time to complete client authentication. | –  | 
| auto\$1explain.log\$1analyze | Use EXPLAIN ANALYZE for plan logging. | –  | 
| auto\$1explain.log\$1buffers | Log buffers usage. | –  | 
| auto\$1explain.log\$1format | EXPLAIN format to be used for plan logging. | –  | 
| auto\$1explain.log\$1min\$1duration | Sets the minimum execution time above which plans will be logged. | –  | 
| auto\$1explain.log\$1nested\$1statements | Log nested statements. | –  | 
| auto\$1explain.log\$1timing | Collect timing data, not just row counts. | –  | 
| auto\$1explain.log\$1triggers | Include trigger statistics in plans. | –  | 
| auto\$1explain.log\$1verbose | Use EXPLAIN VERBOSE for plan logging. | –  | 
| auto\$1explain.sample\$1rate | Fraction of queries to process. | –  | 
| babelfishpg\$1tds.listen\$1addresses | Sets the host name or IP address(es to listen TDS to. | \$1  | 
| babelfishpg\$1tds.tds\$1debug\$1log\$1level | Sets logging level in TDS, 0 disables logging | 1  | 
| backend\$1flush\$1after | (8Kb Number of pages after which previously performed writes are flushed to disk. | –  | 
| bytea\$1output | Sets the output format for bytea. | –  | 
| check\$1function\$1bodies | Check function bodies during CREATE FUNCTION. | –  | 
| client\$1connection\$1check\$1interval | Sets the time interval between checks for disconnection while running queries. | –  | 
| client\$1min\$1messages | Sets the message levels that are sent to the client. | –  | 
| config\$1file | Sets the servers main configuration file. | /rdsdbdata/config/postgresql.conf  | 
| constraint\$1exclusion | Enables the planner to use constraints to optimize queries. | –  | 
| cpu\$1index\$1tuple\$1cost | Sets the planners estimate of the cost of processing each index entry during an index scan. | –  | 
| cpu\$1operator\$1cost | Sets the planners estimate of the cost of processing each operator or function call. | –  | 
| cpu\$1tuple\$1cost | Sets the planners estimate of the cost of processing each tuple (row. | –  | 
| cron.database\$1name | Sets the database to store pg\$1cron metadata tables | postgres  | 
| cron.log\$1run | Log all jobs runs into the job\$1run\$1details table | on  | 
| cron.log\$1statement | Log all cron statements prior to execution. | off  | 
| cron.max\$1running\$1jobs | Maximum number of jobs that can run concurrently. | 5  | 
| cron.use\$1background\$1workers | Enables background workers for pg\$1cron | on  | 
| cursor\$1tuple\$1fraction | Sets the planners estimate of the fraction of a cursors rows that will be retrieved. | –  | 
| db\$1user\$1namespace | Enables per-database user names. | –  | 
| deadlock\$1timeout | (ms Sets the time to wait on a lock before checking for deadlock. | –  | 
| debug\$1pretty\$1print | Indents parse and plan tree displays. | –  | 
| debug\$1print\$1parse | Logs each querys parse tree. | –  | 
| debug\$1print\$1plan | Logs each querys execution plan. | –  | 
| debug\$1print\$1rewritten | Logs each querys rewritten parse tree. | –  | 
| default\$1statistics\$1target | Sets the default statistics target. | –  | 
| default\$1transaction\$1deferrable | Sets the default deferrable status of new transactions. | –  | 
| default\$1transaction\$1isolation | Sets the transaction isolation level of each new transaction. | –  | 
| default\$1transaction\$1read\$1only | Sets the default read-only status of new transactions. | –  | 
| effective\$1cache\$1size | (8kB Sets the planners assumption about the size of the disk cache. | SUM(DBInstanceClassMemory/12038,-50003  | 
| effective\$1io\$1concurrency | Number of simultaneous requests that can be handled efficiently by the disk subsystem. | –  | 
| enable\$1async\$1append | Enables the planners use of async append plans. | –  | 
| enable\$1bitmapscan | Enables the planners use of bitmap-scan plans. | –  | 
| enable\$1gathermerge | Enables the planners use of gather merge plans. | –  | 
| enable\$1hashagg | Enables the planners use of hashed aggregation plans. | –  | 
| enable\$1hashjoin | Enables the planners use of hash join plans. | –  | 
| enable\$1incremental\$1sort | Enables the planners use of incremental sort steps. | –  | 
| enable\$1indexonlyscan | Enables the planners use of index-only-scan plans. | –  | 
| enable\$1indexscan | Enables the planners use of index-scan plans. | –  | 
| enable\$1material | Enables the planners use of materialization. | –  | 
| enable\$1memoize | Enables the planners use of memoization | –  | 
| enable\$1mergejoin | Enables the planners use of merge join plans. | –  | 
| enable\$1nestloop | Enables the planners use of nested-loop join plans. | –  | 
| enable\$1parallel\$1append | Enables the planners use of parallel append plans. | –  | 
| enable\$1parallel\$1hash | Enables the planners user of parallel hash plans. | –  | 
| enable\$1partition\$1pruning | Enable plan-time and run-time partition pruning. | –  | 
| enable\$1partitionwise\$1aggregate | Enables partitionwise aggregation and grouping. | –  | 
| enable\$1partitionwise\$1join | Enables partitionwise join. | –  | 
| enable\$1seqscan | Enables the planners use of sequential-scan plans. | –  | 
| enable\$1sort | Enables the planners use of explicit sort steps. | –  | 
| enable\$1tidscan | Enables the planners use of TID scan plans. | –  | 
| escape\$1string\$1warning | Warn about backslash escapes in ordinary string literals. | –  | 
| exit\$1on\$1error | Terminate session on any error. | –  | 
| force\$1parallel\$1mode | Forces use of parallel query facilities. | –  | 
| from\$1collapse\$1limit | Sets the FROM-list size beyond which subqueries are not collapsed. | –  | 
| geqo | Enables genetic query optimization. | –  | 
| geqo\$1effort | GEQO: effort is used to set the default for other GEQO parameters. | –  | 
| geqo\$1generations | GEQO: number of iterations of the algorithm. | –  | 
| geqo\$1pool\$1size | GEQO: number of individuals in the population. | –  | 
| geqo\$1seed | GEQO: seed for random path selection. | –  | 
| geqo\$1selection\$1bias | GEQO: selective pressure within the population. | –  | 
| geqo\$1threshold | Sets the threshold of FROM items beyond which GEQO is used. | –  | 
| gin\$1fuzzy\$1search\$1limit | Sets the maximum allowed result for exact search by GIN. | –  | 
| gin\$1pending\$1list\$1limit | (kB Sets the maximum size of the pending list for GIN index. | –  | 
| hash\$1mem\$1multiplier | Multiple of work\$1mem to use for hash tables. | –  | 
| hba\$1file | Sets the servers hba configuration file. | /rdsdbdata/config/pg\$1hba.conf  | 
| hot\$1standby\$1feedback | Allows feedback from a hot standby to the primary that will avoid query conflicts. | on  | 
| ident\$1file | Sets the servers ident configuration file. | /rdsdbdata/config/pg\$1ident.conf  | 
| idle\$1in\$1transaction\$1session\$1timeout | (ms Sets the maximum allowed duration of any idling transaction. | 86400000  | 
| idle\$1session\$1timeout | Terminate any session that has been idle (that is, waiting for a client query, but not within an open transaction, for longer than the specified amount of time | –  | 
| join\$1collapse\$1limit | Sets the FROM-list size beyond which JOIN constructs are not flattened. | –  | 
| lc\$1messages | Sets the language in which messages are displayed. | –  | 
| listen\$1addresses | Sets the host name or IP address(es to listen to. | \$1  | 
| lo\$1compat\$1privileges | Enables backward compatibility mode for privilege checks on large objects. | 0  | 
| log\$1connections | Logs each successful connection. | –  | 
| log\$1destination | Sets the destination for server log output. | stderr  | 
| log\$1directory | Sets the destination directory for log files. | /rdsdbdata/log/error  | 
| log\$1disconnections | Logs end of a session, including duration. | –  | 
| log\$1duration | Logs the duration of each completed SQL statement. | –  | 
| log\$1error\$1verbosity | Sets the verbosity of logged messages. | –  | 
| log\$1executor\$1stats | Writes executor performance statistics to the server log. | –  | 
| log\$1file\$1mode | Sets the file permissions for log files. | 0644  | 
| log\$1filename | Sets the file name pattern for log files. | postgresql.log.%Y-%m-%d-%H%M  | 
| logging\$1collector | Start a subprocess to capture stderr output and/or csvlogs into log files. | 1  | 
| log\$1hostname | Logs the host name in the connection logs. | 0  | 
| logical\$1decoding\$1work\$1mem | (kB This much memory can be used by each internal reorder buffer before spilling to disk. | –  | 
| log\$1line\$1prefix | Controls information prefixed to each log line. | %t:%r:%u@%d:%p]:  | 
| log\$1lock\$1waits | Logs long lock waits. | –  | 
| log\$1min\$1duration\$1sample | (ms Sets the minimum execution time above which a sample of statements will be logged. Sampling is determined by log\$1statement\$1sample\$1rate. | –  | 
| log\$1min\$1duration\$1statement | (ms Sets the minimum execution time above which statements will be logged. | –  | 
| log\$1min\$1error\$1statement | Causes all statements generating error at or above this level to be logged. | –  | 
| log\$1min\$1messages | Sets the message levels that are logged. | –  | 
| log\$1parameter\$1max\$1length | (B When logging statements, limit logged parameter values to first N bytes. | –  | 
| log\$1parameter\$1max\$1length\$1on\$1error | (B When reporting an error, limit logged parameter values to first N bytes. | –  | 
| log\$1parser\$1stats | Writes parser performance statistics to the server log. | –  | 
| log\$1planner\$1stats | Writes planner performance statistics to the server log. | –  | 
| log\$1replication\$1commands | Logs each replication command. | –  | 
| log\$1rotation\$1age | (min Automatic log file rotation will occur after N minutes. | 60  | 
| log\$1rotation\$1size | (kB Automatic log file rotation will occur after N kilobytes. | 100000  | 
| log\$1statement | Sets the type of statements logged. | –  | 
| log\$1statement\$1sample\$1rate | Fraction of statements exceeding log\$1min\$1duration\$1sample to be logged. | –  | 
| log\$1statement\$1stats | Writes cumulative performance statistics to the server log. | –  | 
| log\$1temp\$1files | (kB Log the use of temporary files larger than this number of kilobytes. | –  | 
| log\$1timezone | Sets the time zone to use in log messages. | UTC  | 
| log\$1truncate\$1on\$1rotation | Truncate existing log files of same name during log rotation. | 0  | 
| maintenance\$1io\$1concurrency | A variant of effective\$1io\$1concurrency that is used for maintenance work. | 1  | 
| maintenance\$1work\$1mem | (kB Sets the maximum memory to be used for maintenance operations. | GREATEST(DBInstanceClassMemory/63963136\$11024,65536  | 
| max\$1connections | Sets the maximum number of concurrent connections. | LEAST(DBInstanceClassMemory/9531392,5000  | 
| max\$1files\$1per\$1process | Sets the maximum number of simultaneously open files for each server process. | –  | 
| max\$1locks\$1per\$1transaction | Sets the maximum number of locks per transaction. | 64  | 
| max\$1parallel\$1maintenance\$1workers | Sets the maximum number of parallel processes per maintenance operation. | –  | 
| max\$1parallel\$1workers | Sets the maximum number of parallel workers than can be active at one time. | GREATEST(\$1DBInstanceVCPU/2,8  | 
| max\$1parallel\$1workers\$1per\$1gather | Sets the maximum number of parallel processes per executor node. | –  | 
| max\$1pred\$1locks\$1per\$1page | Sets the maximum number of predicate-locked tuples per page. | –  | 
| max\$1pred\$1locks\$1per\$1relation | Sets the maximum number of predicate-locked pages and tuples per relation. | –  | 
| max\$1pred\$1locks\$1per\$1transaction | Sets the maximum number of predicate locks per transaction. | –  | 
| max\$1slot\$1wal\$1keep\$1size | (MB Replication slots will be marked as failed, and segments released for deletion or recycling, if this much space is occupied by WAL on disk. | –  | 
| max\$1stack\$1depth | (kB Sets the maximum stack depth, in kilobytes. | 6144  | 
| max\$1standby\$1streaming\$1delay | (ms Sets the maximum delay before canceling queries when a hot standby server is processing streamed WAL data. | 14000  | 
| max\$1worker\$1processes | Sets the maximum number of concurrent worker processes. | GREATEST(\$1DBInstanceVCPU\$12,8  | 
| min\$1dynamic\$1shared\$1memory | (MB Amount of dynamic shared memory reserved at startup. | –  | 
| min\$1parallel\$1index\$1scan\$1size | (8kB Sets the minimum amount of index data for a parallel scan. | –  | 
| min\$1parallel\$1table\$1scan\$1size | (8kB Sets the minimum amount of table data for a parallel scan. | –  | 
| old\$1snapshot\$1threshold | (min Time before a snapshot is too old to read pages changed after the snapshot was taken. | –  | 
| parallel\$1leader\$1participation | Controls whether Gather and Gather Merge also run subplans. | –  | 
| parallel\$1setup\$1cost | Sets the planners estimate of the cost of starting up worker processes for parallel query. | –  | 
| parallel\$1tuple\$1cost | Sets the planners estimate of the cost of passing each tuple (row from worker to master backend. | –  | 
| pgaudit.log | Specifies which classes of statements will be logged by session audit logging. | –  | 
| pgaudit.log\$1catalog | Specifies that session logging should be enabled in the case where all relations in a statement are in pg\$1catalog. | –  | 
| pgaudit.log\$1level | Specifies the log level that will be used for log entries. | –  | 
| pgaudit.log\$1parameter | Specifies that audit logging should include the parameters that were passed with the statement. | –  | 
| pgaudit.log\$1relation | Specifies whether session audit logging should create a separate log entry for each relation (TABLE, VIEW, etc. referenced in a SELECT or DML statement. | –  | 
| pgaudit.log\$1statement\$1once | Specifies whether logging will include the statement text and parameters with the first log entry for a statement/substatement combination or with every entry. | –  | 
| pgaudit.role | Specifies the master role to use for object audit logging. | –  | 
| pg\$1bigm.enable\$1recheck | It specifies whether to perform Recheck which is an internal process of full text search. | on  | 
| pg\$1bigm.gin\$1key\$1limit | It specifies the maximum number of 2-grams of the search keyword to be used for full text search. | 0  | 
| pg\$1bigm.last\$1update | It reports the last updated date of the pg\$1bigm module. | 2013.11.22  | 
| pg\$1bigm.similarity\$1limit | It specifies the minimum threshold used by the similarity search. | 0.3  | 
| pg\$1hint\$1plan.debug\$1print | Logs results of hint parsing. | –  | 
| pg\$1hint\$1plan.enable\$1hint | Force planner to use plans specified in the hint comment preceding to the query. | –  | 
| pg\$1hint\$1plan.enable\$1hint\$1table | Force planner to not get hint by using table lookups. | –  | 
| pg\$1hint\$1plan.message\$1level | Message level of debug messages. | –  | 
| pg\$1hint\$1plan.parse\$1messages | Message level of parse errors. | –  | 
| pglogical.batch\$1inserts | Batch inserts if possible | –  | 
| pglogical.conflict\$1log\$1level | Sets log level used for logging resolved conflicts. | –  | 
| pglogical.conflict\$1resolution | Sets method used for conflict resolution for resolvable conflicts. | –  | 
| pglogical.extra\$1connection\$1options | connection options to add to all peer node connections | –  | 
| pglogical.synchronous\$1commit | pglogical specific synchronous commit value | –  | 
| pglogical.use\$1spi | Use SPI instead of low-level API for applying changes | –  | 
| pg\$1similarity.block\$1is\$1normalized | Sets if the result value is normalized or not. | –  | 
| pg\$1similarity.block\$1threshold | Sets the threshold used by the Block similarity function. | –  | 
| pg\$1similarity.block\$1tokenizer | Sets the tokenizer for Block similarity function. | –  | 
| pg\$1similarity.cosine\$1is\$1normalized | Sets if the result value is normalized or not. | –  | 
| pg\$1similarity.cosine\$1threshold | Sets the threshold used by the Cosine similarity function. | –  | 
| pg\$1similarity.cosine\$1tokenizer | Sets the tokenizer for Cosine similarity function. | –  | 
| pg\$1similarity.dice\$1is\$1normalized | Sets if the result value is normalized or not. | –  | 
| pg\$1similarity.dice\$1threshold | Sets the threshold used by the Dice similarity measure. | –  | 
| pg\$1similarity.dice\$1tokenizer | Sets the tokenizer for Dice similarity measure. | –  | 
| pg\$1similarity.euclidean\$1is\$1normalized | Sets if the result value is normalized or not. | –  | 
| pg\$1similarity.euclidean\$1threshold | Sets the threshold used by the Euclidean similarity measure. | –  | 
| pg\$1similarity.euclidean\$1tokenizer | Sets the tokenizer for Euclidean similarity measure. | –  | 
| pg\$1similarity.hamming\$1is\$1normalized | Sets if the result value is normalized or not. | –  | 
| pg\$1similarity.hamming\$1threshold | Sets the threshold used by the Block similarity metric. | –  | 
| pg\$1similarity.jaccard\$1is\$1normalized | Sets if the result value is normalized or not. | –  | 
| pg\$1similarity.jaccard\$1threshold | Sets the threshold used by the Jaccard similarity measure. | –  | 
| pg\$1similarity.jaccard\$1tokenizer | Sets the tokenizer for Jaccard similarity measure. | –  | 
| pg\$1similarity.jaro\$1is\$1normalized | Sets if the result value is normalized or not. | –  | 
| pg\$1similarity.jaro\$1threshold | Sets the threshold used by the Jaro similarity measure. | –  | 
| pg\$1similarity.jarowinkler\$1is\$1normalized | Sets if the result value is normalized or not. | –  | 
| pg\$1similarity.jarowinkler\$1threshold | Sets the threshold used by the Jarowinkler similarity measure. | –  | 
| pg\$1similarity.levenshtein\$1is\$1normalized | Sets if the result value is normalized or not. | –  | 
| pg\$1similarity.levenshtein\$1threshold | Sets the threshold used by the Levenshtein similarity measure. | –  | 
| pg\$1similarity.matching\$1is\$1normalized | Sets if the result value is normalized or not. | –  | 
| pg\$1similarity.matching\$1threshold | Sets the threshold used by the Matching Coefficient similarity measure. | –  | 
| pg\$1similarity.matching\$1tokenizer | Sets the tokenizer for Matching Coefficient similarity measure. | –  | 
| pg\$1similarity.mongeelkan\$1is\$1normalized | Sets if the result value is normalized or not. | –  | 
| pg\$1similarity.mongeelkan\$1threshold | Sets the threshold used by the Monge-Elkan similarity measure. | –  | 
| pg\$1similarity.mongeelkan\$1tokenizer | Sets the tokenizer for Monge-Elkan similarity measure. | –  | 
| pg\$1similarity.nw\$1gap\$1penalty | Sets the gap penalty used by the Needleman-Wunsch similarity measure. | –  | 
| pg\$1similarity.nw\$1is\$1normalized | Sets if the result value is normalized or not. | –  | 
| pg\$1similarity.nw\$1threshold | Sets the threshold used by the Needleman-Wunsch similarity measure. | –  | 
| pg\$1similarity.overlap\$1is\$1normalized | Sets if the result value is normalized or not. | –  | 
| pg\$1similarity.overlap\$1threshold | Sets the threshold used by the Overlap Coefficient similarity measure. | –  | 
| pg\$1similarity.overlap\$1tokenizer | Sets the tokenizer for Overlap Coefficientsimilarity measure. | –  | 
| pg\$1similarity.qgram\$1is\$1normalized | Sets if the result value is normalized or not. | –  | 
| pg\$1similarity.qgram\$1threshold | Sets the threshold used by the Q-Gram similarity measure. | –  | 
| pg\$1similarity.qgram\$1tokenizer | Sets the tokenizer for Q-Gram measure. | –  | 
| pg\$1similarity.swg\$1is\$1normalized | Sets if the result value is normalized or not. | –  | 
| pg\$1similarity.swg\$1threshold | Sets the threshold used by the Smith-Waterman-Gotoh similarity measure. | –  | 
| pg\$1similarity.sw\$1is\$1normalized | Sets if the result value is normalized or not. | –  | 
| pg\$1similarity.sw\$1threshold | Sets the threshold used by the Smith-Waterman similarity measure. | –  | 
| pg\$1stat\$1statements.max | Sets the maximum number of statements tracked by pg\$1stat\$1statements. | –  | 
| pg\$1stat\$1statements.save | Save pg\$1stat\$1statements statistics across server shutdowns. | –  | 
| pg\$1stat\$1statements.track | Selects which statements are tracked by pg\$1stat\$1statements. | –  | 
| pg\$1stat\$1statements.track\$1planning | Selects whether planning duration is tracked by pg\$1stat\$1statements. | –  | 
| pg\$1stat\$1statements.track\$1utility | Selects whether utility commands are tracked by pg\$1stat\$1statements. | –  | 
| postgis.gdal\$1enabled\$1drivers | Enable or disable GDAL drivers used with PostGIS in Postgres 9.3.5 and above. | ENABLE\$1ALL  | 
| quote\$1all\$1identifiers | When generating SQL fragments, quote all identifiers. | –  | 
| random\$1page\$1cost | Sets the planners estimate of the cost of a nonsequentially fetched disk page. | –  | 
| rds.enable\$1memory\$1management | Improves memory management capabilities in Aurora PostgreSQL 12.17, 13.13, 14.10, 15.5, and higher versions that prevents stability issues and database restarts caused by insufficient free memory. For more information, see [Improved memory management in Aurora PostgreSQLLimitation](AuroraPostgreSQL.BestPractices.memory.management.md). | True  | 
| rds.force\$1admin\$1logging\$1level | See log messages for RDS admin user actions in customer databases. | –  | 
| rds.log\$1retention\$1period | Amazon RDS will delete PostgreSQL log that are older than N minutes. | 4320  | 
| rds.memory\$1allocation\$1guard | Improves memory management capabilities in Aurora PostgreSQL 11.21, 12.16, 13.12, 14.9, 15.4, and older versions that prevents stability issues and database restarts caused by insufficient free memory. For more information, see [Improved memory management in Aurora PostgreSQLLimitation](AuroraPostgreSQL.BestPractices.memory.management.md). | False  | 
| rds.pg\$1stat\$1ramdisk\$1size | Size of the stats ramdisk in MB. A nonzero value will setup the ramdisk. | 0  | 
| rds.rds\$1superuser\$1reserved\$1connections | Sets the number of connection slots reserved for rds\$1superusers. This parameter is only available in versions 15 and earlier. For more information, see the PostgreSQL documentation [reserved connections](https://www.postgresql.org/docs/current/runtime-config-connection.html#GUC-RESERVED-CONNECTIONS).  | 2  | 
| rds.superuser\$1variables | List of superuser-only variables for which we elevate rds\$1superuser modification statements. | session\$1replication\$1role  | 
| remove\$1temp\$1files\$1after\$1crash | Remove temporary files after backend crash. | 0  | 
| restart\$1after\$1crash | Reinitialize server after backend crash. | –  | 
| row\$1security | Enable row security. | –  | 
| search\$1path | Sets the schema search order for names that are not schema-qualified. | –  | 
| seq\$1page\$1cost | Sets the planners estimate of the cost of a sequentially fetched disk page. | –  | 
| session\$1replication\$1role | Sets the sessions behavior for triggers and rewrite rules. | –  | 
| shared\$1buffers | (8kB) Sets the number of shared memory buffers used by the server. | SUM(DBInstanceClassMemory/12038,-50003)  | 
| shared\$1preload\$1libraries | Lists shared libraries to preload into server. | pg\$1stat\$1statements  | 
| ssl\$1ca\$1file | Location of the SSL server authority file. | /rdsdbdata/rds-metadata/ca-cert.pem  | 
| ssl\$1cert\$1file | Location of the SSL server certificate file. | /rdsdbdata/rds-metadata/server-cert.pem  | 
| ssl\$1crl\$1dir | Location of the SSL certificate revocation list directory. | /rdsdbdata/rds-metadata/ssl\$1crl\$1dir/  | 
| ssl\$1key\$1file |  Location of the SSL server private key file | /rdsdbdata/rds-metadata/server-key.pem  | 
| standard\$1conforming\$1strings | Causes ... strings to treat backslashes literally. | –  | 
| statement\$1timeout | (ms Sets the maximum allowed duration of any statement. | –  | 
| stats\$1temp\$1directory | Writes temporary statistics files to the specified directory. | /rdsdbdata/db/pg\$1stat\$1tmp  | 
| superuser\$1reserved\$1connections | Sets the number of connection slots reserved for superusers. | 3  | 
| synchronize\$1seqscans | Enable synchronized sequential scans. | –  | 
| tcp\$1keepalives\$1count | Maximum number of TCP keepalive retransmits. | –  | 
| tcp\$1keepalives\$1idle | (s Time between issuing TCP keepalives. | –  | 
| tcp\$1keepalives\$1interval | (s Time between TCP keepalive retransmits. | –  | 
| temp\$1buffers | (8kB Sets the maximum number of temporary buffers used by each session. | –  | 
| temp\$1file\$1limit | Constrains the total amount disk space in kilobytes that a given PostgreSQL process can use for temporary files, excluding space used for explicit temporary tables | -1  | 
| temp\$1tablespaces | Sets the tablespace(s to use for temporary tables and sort files. | –  | 
| track\$1activities | Collects information about executing commands. | –  | 
| track\$1activity\$1query\$1size | Sets the size reserved for pg\$1stat\$1activity.current\$1query, in bytes. | 4096  | 
| track\$1counts | Collects statistics on database activity. | –  | 
| track\$1functions | Collects function-level statistics on database activity. | pl  | 
| track\$1io\$1timing | Collects timing statistics on database IO activity. | 1  | 
| transform\$1–\$1equals | Treats expr=– as expr IS –. | –  | 
| update\$1process\$1title | Updates the process title to show the active SQL command. | –  | 
| wal\$1receiver\$1status\$1interval | (s Sets the maximum interval between WAL receiver status reports to the primary. | –  | 
| work\$1mem | (kB Sets the maximum memory to be used for query workspaces. | –  | 
| xmlbinary | Sets how binary values are to be encoded in XML. | –  | 
| xmloption | Sets whether XML data in implicit parsing and serialization operations is to be considered as documents or content fragments. | – | 

# Amazon Aurora PostgreSQL wait events
<a name="AuroraPostgreSQL.Reference.Waitevents"></a>

The following are common wait events for Aurora PostgreSQL. To learn more about wait events and tuning your Aurora PostgreSQL DB cluster, see [Tuning with wait events for Aurora PostgreSQL](AuroraPostgreSQL.Tuning.md). 

**Activity:ArchiverMain**  
The archiver process is waiting for activity.

**Activity:AutoVacuumMain**  
The autovacuum launcher process is waiting for activity.

**Activity:BgWriterHibernate**  
The background writer process is hibernating while waiting for activity.

**Activity:BgWriterMain**  
The background writer process is waiting for activity.

**Activity:CheckpointerMain**  
The checkpointer process is waiting for activity.

**Activity:LogicalApplyMain**  
The logical replication apply process is waiting for activity.

**Activity:LogicalLauncherMain**  
The logical replication launcher process is waiting for activity.

**Activity:PgStatMain**  
The statistics collector process is waiting for activity.

**Activity:RecoveryWalAll**  
A process is waiting for the write-ahead log (WAL) from a stream at recovery.

**Activity:RecoveryWalStream**  
The startup process is waiting for the write-ahead log (WAL) to arrive during streaming recovery.

**Activity:SysLoggerMain**  
The syslogger process is waiting for activity.

**Activity:WalReceiverMain**  
The write-ahead log (WAL) receiver process is waiting for activity.

**Activity:WalSenderMain**  
The write-ahead log (WAL) sender process is waiting for activity.

**Activity:WalWriterMain**  
The write-ahead log (WAL) writer process is waiting for activity.

**BufferPin:BufferPin**  
A process is waiting to acquire an exclusive pin on a buffer.

**Client:GSSOpenServer**  
A process is waiting to read data from the client while establishing a Generic Security Service Application Program Interface (GSSAPI) session.

**Client:ClientRead**  
A backend process is waiting to receive data from a PostgreSQL client. For more information, see [Client:ClientRead](apg-waits.clientread.md).

**Client:ClientWrite**  
A backend process is waiting to send more data to a PostgreSQL client. For more information, see [Client:ClientWrite](apg-waits.clientwrite.md).

**Client:LibPQWalReceiverConnect**  
A process is waiting in the write-ahead log (WAL) receiver to establish connection to remote server.

**Client:LibPQWalReceiverReceive**  
A process is waiting in the write-ahead log (WAL) receiver to receive data from remote server.

**Client:SSLOpenServer**  
A process is waiting for Secure Sockets Layer (SSL) while attempting connection.

**Client:WalReceiverWaitStart**  
A process is waiting for startup process to send initial data for streaming replication.

**Client:WalSenderWaitForWAL**  
A process is waiting for the write-ahead log (WAL) to be flushed in the WAL sender process.

**Client:WalSenderWriteData**  
A process is waiting for any activity when processing replies from the write-ahead log (WAL) receiver in the WAL sender process.

**CPU**  
A backend process is active in or is waiting for CPU. For more information, see [CPU](apg-waits.cpu.md).

**Extension:extension**  
A backend process is waiting for a condition defined by an extension or module.

**IO:AuroraEnhancedLogicalWALRead**  
A backend process is fetching log records from the change data capture (CDC) volume.

**IO:AuroraOptimizedReadsCacheRead**  
A process is waiting for a read from Optimized Reads tiered cache because the page isn't available in shared memory.

**IO:AuroraOptimizedReadsCacheSegmentTruncate**  
A process is waiting for an Optimized Reads tiered cache segment file to be truncated.

**IO:AuroraOptimizedReadsCacheWrite**  
The background writer process is waiting to write in Optimized Reads tiered cache.

**IO:AuroraStorageLogAllocate**  
A session is allocating metadata and preparing for a transaction log write.

**IO:BufFileRead**  
When operations require more memory than the amount defined by working memory parameters, the engine creates temporary files on disk. This wait event occurs when operations read from the temporary files. For more information, see [IO:BufFileRead and IO:BufFileWrite](apg-waits.iobuffile.md).

**IO:BufFileWrite**  
When operations require more memory than the amount defined by working memory parameters, the engine creates temporary files on disk. This wait event occurs when operations write to the temporary files. For more information, see [IO:BufFileRead and IO:BufFileWrite](apg-waits.iobuffile.md).

**IO:ControlFileRead**  
A process is waiting for a read from the `pg_control` file.

**IO:ControlFileSync**  
A process is waiting for the `pg_control` file to reach durable storage.

**IO:ControlFileSyncUpdate**  
A process is waiting for an update to the `pg_control` file to reach durable storage.

**IO:ControlFileWrite**  
A process is waiting for a write to the `pg_control` file.

**IO:ControlFileWriteUpdate**  
A process is waiting for a write to update the `pg_control` file.

**IO:CopyFileRead**  
A process is waiting for a read during a file copy operation.

**IO:CopyFileWrite**  
A process is waiting for a write during a file copy operation.

**IO:DataFileExtend**  
A process is waiting for a relation data file to be extended.

**IO:DataFileFlush**  
A process is waiting for a relation data file to reach durable storage.

**IO:DataFileImmediateSync**  
A process is waiting for an immediate synchronization of a relation data file to durable storage.

**IO:DataFilePrefetch**  
A process is waiting for an asynchronous prefetch from a relation data file.

**IO:DataFileSync**  
A process is waiting for changes to a relation data file to reach durable storage.

**IO:DataFileRead**  
A backend process tried to find a page in the shared buffers, didn't find it, and so read it from storage. For more information, see [IO:DataFileRead](apg-waits.iodatafileread.md).

**IO:DataFileTruncate**  
A process is waiting for a relation data file to be truncated.

**IO:DataFileWrite**  
A process is waiting for a write to a relation data file.

**IO:DSMFillZeroWrite**  
A process is waiting to write zero bytes to a dynamic shared memory backing file.

**IO:LockFileAddToDataDirRead**  
A process is waiting for a read while adding a line to the data directory lock file.

**IO:LockFileAddToDataDirSync**  
A process is waiting for data to reach durable storage while adding a line to the data directory lock file.

**IO:LockFileAddToDataDirWrite**  
A process is waiting for a write while adding a line to the data directory lock file.

**IO:LockFileCreateRead**  
A process is waiting to read while creating the data directory lock file.

**IO:LockFileCreateSync**  
A process is waiting for data to reach durable storage while creating the data directory lock file.

**IO:LockFileCreateWrite**  
A process is waiting for a write while creating the data directory lock file.

**IO:LockFileReCheckDataDirRead**  
A process is waiting for a read during recheck of the data directory lock file.

**IO:LogicalRewriteCheckpointSync**  
A process is waiting for logical rewrite mappings to reach durable storage during a checkpoint.

**IO:LogicalRewriteMappingSync**  
A process is waiting for mapping data to reach durable storage during a logical rewrite.

**IO:LogicalRewriteMappingWrite**  
A process is waiting for a write of mapping data during a logical rewrite.

**IO:LogicalRewriteSync**  
A process is waiting for logical rewrite mappings to reach durable storage.

**IO:LogicalRewriteTruncate**  
A process is waiting for the truncation of mapping data during a logical rewrite.

**IO:LogicalRewriteWrite**  
A process is waiting for a write of logical rewrite mappings.

**IO:RelationMapRead**  
A process is waiting for a read of the relation map file.

**IO:RelationMapSync**  
A process is waiting for the relation map file to reach durable storage.

**IO:RelationMapWrite**  
A process is waiting for a write to the relation map file.

**IO:ReorderBufferRead**  
A process is waiting for a read during reorder buffer management.

**IO:ReorderBufferWrite**  
A process is waiting for a write during reorder buffer management.

**IO:ReorderLogicalMappingRead**  
A process is waiting for a read of a logical mapping during reorder buffer management.

**IO:ReplicationSlotRead**  
A process is waiting for a read from a replication slot control file.

**IO:ReplicationSlotRestoreSync**  
A process is waiting for a replication slot control file to reach durable storage while restoring it to memory.

**IO:ReplicationSlotSync**  
A process is waiting for a replication slot control file to reach durable storage.

**IO:ReplicationSlotWrite**  
A process is waiting for a write to a replication slot control file.

**IO:SLRUFlushSync**  
A process is waiting for simple least-recently used (SLRU) data to reach durable storage during a checkpoint or database shutdown.

**IO:SLRURead**  
A process is waiting for a read of a simple least-recently used (SLRU) page.

**IO:SLRUSync**  
A process is waiting for simple least-recently used (SLRU) data to reach durable storage following a page write.

**IO:SLRUWrite**  
A process is waiting for a write of a simple least-recently used (SLRU) page.

**IO:SnapbuildRead**  
A process is waiting for a read of a serialized historical catalog snapshot.

**IO:SnapbuildSync**  
A process is waiting for a serialized historical catalog snapshot to reach durable storage.

**IO:SnapbuildWrite**  
A process is waiting for a write of a serialized historical catalog snapshot.

**IO:TimelineHistoryFileSync**  
A process is waiting for a timeline history file received through streaming replication to reach durable storage.

**IO:TimelineHistoryFileWrite**  
A process is waiting for a write of a timeline history file received through streaming replication.

**IO:TimelineHistoryRead**  
A process is waiting for a read of a timeline history file.

**IO:TimelineHistorySync**  
A process is waiting for a newly created timeline history file to reach durable storage.

**IO:TimelineHistoryWrite**  
A process is waiting for a write of a newly created timeline history file.

**IO:TwophaseFileRead**  
A process is waiting for a read of a two phase state file.

**IO:TwophaseFileSync**  
A process is waiting for a two phase state file to reach durable storage.

**IO:TwophaseFileWrite**  
A process is waiting for a write of a two phase state file.

**IO:WALBootstrapSync**  
A process is waiting for the write-ahead log (WAL) to reach durable storage during bootstrapping.

**IO:WALBootstrapWrite**  
A process is waiting for a write of a write-ahead log (WAL) page during bootstrapping.

**IO:WALCopyRead**  
A process is waiting for a read when creating a new write-ahead log (WAL) segment by copying an existing one.

**IO:WALCopySync**  
A process is waiting for a new write-ahead log (WAL) segment created by copying an existing one to reach durable storage. 

**IO:WALCopyWrite**  
A process is waiting for a write when creating a new write-ahead log (WAL) segment by copying an existing one.

**IO:WALInitSync**  
A process is waiting for a newly initialized write-ahead log (WAL) file to reach durable storage.

**IO:WALInitWrite**  
A process is waiting for a write while initializing a new write-ahead log (WAL) file.

**IO:WALRead**  
A process is waiting for a read from a write-ahead log (WAL) file.

**IO:WALSenderTimelineHistoryRead**  
A process is waiting for a read from a timeline history file during a WAL sender timeline command.

**IO:WALSync**  
A process is waiting for a write-ahead log (WAL) file to reach durable storage.

**IO:WALSyncMethodAssign**  
A process is waiting for data to reach durable storage while assigning a new write-ahead log (WAL) sync method.

**IO:WALWrite**  
A process is waiting for a write to a write-ahead log (WAL) file.

**IO:XactSync**  
A backend process is waiting for the Aurora storage subsystem to acknowledge the commit of a regular transaction, or the commit or rollback of a prepared transaction. For more information, see [IO:XactSync](apg-waits.xactsync.md).

**IPC:AuroraLogicalSchemaUpdate**  
Two backend processes are attempting to insert the same entry into the schema cache. One process will continue while the other waits for it to complete.

**IPC:AuroraOptimizedReadsCacheWriteStop**  
A process is waiting for the background writer to stop writing into Optimized Reads tiered cache.

**IPC:BackupWaitWalArchive**  
A process is waiting for write-ahead log (WAL) files required for a backup to be successfully archived.

**IPC:BgWorkerShutdown**  
A process is waiting for a background worker to shut down.

**IPC:BgWorkerStartup**  
A process is waiting for a background worker to start. 

**IPC:BtreePage**  
A process is waiting for the page number needed to continue a parallel B-tree scan to become available. 

**IPC:CheckpointDone**  
A process is waiting for a checkpoint to complete. 

**IPC:CheckpointStart**  
A process is waiting for a checkpoint to start. 

**IPC:ClogGroupUpdate**  
A process is waiting for the group leader to update the transaction status at a transaction's end.

**IPC:DamRecordTxAck**  
A backend process has generated a database activity streams event and is waiting for the event to become durable. For more information, see [IPC:DamRecordTxAck](apg-waits.ipcdamrecordtxac.md).

**IPC:ExecuteGather**  
A process is waiting for activity from a child process while executing a Gather plan node. 

**IPC:Hash/Batch/Allocating**  
A process is waiting for an elected parallel hash participant to allocate a hash table.

**IPC:Hash/Batch/Electing**  
A process is electing a parallel hash participant to allocate a hash table.

**IPC:Hash/Batch/Loading**  
A process is waiting for other parallel hash participants to finish loading a hash table.

**IPC:Hash/Build/Allocating**  
A process is waiting for an elected parallel hash participant to allocate the initial hash table.

**IPC:Hash/Build/Electing**  
A process is electing a parallel hash participant to allocate the initial hash table.

**IPC:Hash/Build/HashingInner**  
A process is waiting for other parallel hash participants to finish hashing the inner relation.

**IPC:Hash/Build/HashingOuter**  
A process is waiting for other parallel hash participants to finish partitioning the outer relation.

**IPC:Hash/GrowBatches/Allocating**  
A process is waiting for an elected parallel hash participant to allocate more batches.

**IPC:Hash/GrowBatches/Deciding**  
A process is electing a parallel hash participant to decide on future batch growth.

**IPC:Hash/GrowBatches/Electing**  
A process is electing a parallel hash participant to allocate more batches.

**IPC:Hash/GrowBatches/Finishing**  
A process is waiting for an elected parallel hash participant to decide on future batch growth.

**IPC:Hash/GrowBatches/Repartitioning**  
A process is waiting for other parallel hash participants to finishing repartitioning.

**IPC:Hash/GrowBuckets/Allocating**  
A process is waiting for an elected parallel hash participant to finish allocating more buckets.

**IPC:Hash/GrowBuckets/Electing**  
A process is electing a parallel hash participant to allocate more buckets.

**IPC:Hash/GrowBuckets/Reinserting**  
A process is waiting for other parallel hash participants to finish inserting tuples into new buckets.

**IPC:HashBatchAllocate**  
A process is waiting for an elected parallel hash participant to allocate a hash table. 

**IPC:HashBatchElect**  
A process is waiting to elect a parallel hash participant to allocate a hash table. 

**IPC:HashBatchLoad**  
A process is waiting for other parallel hash participants to finish loading a hash table. 

**IPC:HashBuildAllocate**  
A process is waiting for an elected parallel hash participant to allocate the initial hash table. 

**IPC:HashBuildElect**  
A process is waiting to elect a parallel hash participant to allocate the initial hash table. 

**IPC:HashBuildHashInner**  
A process is waiting for other parallel hash participants to finish hashing the inner relation. 

**IPC:'HashBuildHashOuter**  
A process is waiting for other parallel hash participants to finish partitioning the outer relation. 

**IPC:HashGrowBatchesAllocate**  
A process is waiting for an elected parallel hash participant to allocate more batches. 

**IPC:'HashGrowBatchesDecide**  
A process is waiting to elect a parallel hash participant to decide on future batch growth. 

**IPC:HashGrowBatchesElect**  
A process is waiting to elect a parallel hash participant to allocate more batches. 

**IPC:HashGrowBatchesFinish**  
A process is waiting for an elected parallel hash participant to decide on future batch growth. 

**IPC:HashGrowBatchesRepartition**  
A process is waiting for other parallel hash participants to finish repartitioning. 

**IPC:HashGrowBucketsAllocate**  
A process is waiting for an elected parallel hash participant to finish allocating more buckets. 

**IPC:HashGrowBucketsElect**  
A process is waiting to elect a parallel hash participant to allocate more buckets. 

**IPC:HashGrowBucketsReinsert**  
A process is waiting for other parallel hash participants to finish inserting tuples into new buckets. 

**IPC:LogicalSyncData**  
A process is waiting for a logical replication remote server to send data for initial table synchronization. 

**IPC:LogicalSyncStateChange**  
A process is waiting for a logical replication remote server to change state. 

**IPC:MessageQueueInternal**  
A process is waiting for another process to be attached to a shared message queue. 

**IPC:MessageQueuePutMessage**  
A process is waiting to write a protocol message to a shared message queue. 

**IPC:MessageQueueReceive**  
A process is waiting to receive bytes from a shared message queue. 

**IPC:MessageQueueSend**  
A process is waiting to send bytes to a shared message queue. 

**IPC:ParallelBitmapScan**  
A process is waiting for a parallel bitmap scan to become initialized. 

**IPC:ParallelCreateIndexScan**  
A process is waiting for parallel CREATE INDEX workers to finish a heap scan. 

**IPC:ParallelFinish**  
A process is waiting for parallel workers to finish computing. 

**IPC:ProcArrayGroupUpdate**  
A process is waiting for the group leader to clear the transaction ID at transaction end. 

**IPC:ProcSignalBarrier**  
A process is waiting for a barrier event to be processed by all backends. 

**IPC:Promote**  
A process is waiting for standby promotion. 

**IPC:RecoveryConflictSnapshot**  
A process is waiting for recovery conflict resolution for a vacuum cleanup. 

**IPC:RecoveryConflictTablespace**  
A process is waiting for recovery conflict resolution for dropping a tablespace. 

**IPC:RecoveryPause**  
A process is waiting for recovery to be resumed. 

**IPC:ReplicationOriginDrop**  
A process is waiting for a replication origin to become inactive so it can be dropped. 

**IPC:ReplicationSlotDrop**  
A process is waiting for a replication slot to become inactive so it can be dropped. 

**IPC:SafeSnapshot**  
A process is waiting to obtain a valid snapshot for a READ ONLY DEFERRABLE transaction. 

**IPC:SyncRep**  
A process is waiting for confirmation from a remote server during synchronous replication. 

**IPC:XactGroupUpdate**  
A process is waiting for the group leader to update the transaction status at transaction end.

**Lock:advisory**  
A backend process requested an advisory lock and is waiting for it. For more information, see [Lock:advisory](apg-waits.lockadvisory.md).

**Lock:extend**  
A backend process is waiting for a lock to be released so that it can extend a relation. This lock is needed because only one backend process can extend a relation at a time. For more information, see [Lock:extend](apg-waits.lockextend.md).

**Lock:frozenid**  
A process is waiting to update `pg_database.datfrozenxid` and `pg_database.datminmxid`. 

**Lock:object**  
A process is waiting to get a lock on a nonrelation database object.

**Lock:page**  
A process is waiting to get a lock on a page of a relation.

**Lock:Relation**  
A backend process is waiting to acquire a lock on a relation that is locked by another transaction. For more information, see [Lock:Relation](apg-waits.lockrelation.md).

**Lock:spectoken**  
A process is waiting to get a speculative insertion lock.

**Lock:speculative token**  
A process is waiting to acquire a speculative insertion lock.

**Lock:transactionid**  
A transaction is waiting for a row-level lock. For more information, see [Lock:transactionid](apg-waits.locktransactionid.md).

**Lock:tuple**  
A backend process is waiting to acquire a lock on a tuple while another backend process holds a conflicting lock on the same tuple. For more information, see [Lock:tuple](apg-waits.locktuple.md).

**Lock:userlock**  
A process is waiting to get a user lock.

**Lock:virtualxid**  
A process is waiting to get a virtual transaction ID lock.

**LWLock:AddinShmemInit**  
A process is waiting to manage an extension's space allocation in shared memory.

**LWLock:AddinShmemInitLock**  
A process is waiting to manage space allocation in shared memory.

**LWLock:async**  
A process is waiting for I/O on an async (notify) buffer.

**LWLock:AsyncCtlLock**  
A process is waiting to read or update a shared notification state.

**LWLock:AsyncQueueLock**  
A process is waiting to read or update notification messages. 

**LWLock:AuroraOptimizedReadsCacheMapping**  
A process is waiting to associate a data block with a page in the Optimized Reads tiered cache.

**LWLock:AutoFile**  
A process is waiting to update the `postgresql.auto.conf` file.

**LWLock:AutoFileLock**  
A process is waiting to update the `postgresql.auto.conf` file.

**LWLock:Autovacuum**  
A process is waiting to read or update the current state of autovacuum workers.

**LWLock:AutovacuumLock**  
An autovacuum worker or launcher is waiting to update or read the current state of autovacuum workers.

**LWLock:AutovacuumSchedule**  
A process is waiting to ensure that a table selected for autovacuum still needs vacuuming.

**LWLock:AutovacuumScheduleLock**  
A process is waiting to ensure that the table it has selected for a vacuum still needs vacuuming. 

**LWLock:BackendRandomLock**  
A process is waiting to generate a random number. 

**LWLock:BackgroundWorker**  
A process is waiting to read or update background worker state.

**LWLock:BackgroundWorkerLock**  
A process is waiting to read or update the background worker state.

**LWLock:BtreeVacuum**  
A process is waiting to read or update vacuum-related information for a B-tree index.

**LWLock:BtreeVacuumLock**  
A process is waiting to read or update vacuum-related information for a B-tree index.

**LWLock:buffer\$1content**  
A backend process is waiting to acquire a lightweight lock on the contents of a shared memory buffer. For more information, see [LWLock:buffer\$1content (BufferContent)](apg-waits.lockbuffercontent.md).

**LWLock:buffer\$1mapping**  
A backend process is waiting to associate a data block with a buffer in the shared buffer pool. For more information, see [LWLock:buffer\$1mapping](apg-waits.lwl-buffer-mapping.md).

**LWLock:BufferIO**  
A backend process wants to read a page into shared memory. The process is waiting for other processes to finish their I/O for the page. For more information, see [LWLock:BufferIO (IPC:BufferIO)](apg-waits.lwlockbufferio.md).

**LWLock:Checkpoint**  
A process is waiting to begin a checkpoint. 

**LWLock:CheckpointLock**  
A process is waiting to perform checkpoint. 

**LWLock:CheckpointerComm**  
A process is waiting to manage `fsync` requests. 

**LWLock:CheckpointerCommLock**  
A process is waiting to manage `fsync` requests. 

**LWLock:clog**  
A process is waiting for I/O on a clog (transaction status) buffer. 

**LWLock:CLogControlLock**  
A process is waiting to read or update transaction status. 

**LWLock:CLogTruncationLock**  
A process is waiting to run `txid_status` or update the oldest transaction ID available to it. 

**LWLock:commit\$1timestamp**  
A process is waiting for I/O on a commit timestamp buffer. 

**LWLock:CommitTs**  
A process is waiting to read or update the last value set for a transaction commit timestamp. 

**LWLock:CommitTsBuffer**  
A process is waiting for I/O on a simple least-recently used (SLRU) buffer for a commit timestamp. 

**LWLock:CommitTsControlLock**  
A process is waiting to read or update transaction commit timestamps. 

**LWLock:CommitTsLock**  
A process is waiting to read or update the last value set for the transaction timestamp. 

**LWLock:CommitTsSLRU**  
A process is waiting to access the simple least-recently used (SLRU) cache for a commit timestamp. 

**LWLock:ControlFile**  
A process is waiting to read or update the `pg_control` file or create a new write-ahead log (WAL) file. 

**LWLock:ControlFileLock**  
A process is waiting to read or update the control file or creation of a new write-ahead log (WAL) file. 

**LWLock:DynamicSharedMemoryControl**  
A process is waiting to read or update dynamic shared memory allocation information. 

**LWLock:DynamicSharedMemoryControlLock**  
A process is waiting to read or update the dynamic shared memory state. 

**LWLock:lock\$1manager**  
A backend process is waiting to add or examine locks for backend processes. Or it's waiting to join or exit a locking group that is used by parallel query. For more information, see [LWLock:lock\$1manager](apg-waits.lw-lock-manager.md).

**LWLock:LockFastPath**  
A process is waiting to read or update a process's fast-path lock information. 

**LWLock:LogicalRepWorker**  
A process is waiting to read or update the state of logical replication workers. 

**LWLock:LogicalRepWorkerLock**  
A process is waiting for an action on a logical replication worker to finish. 

**LWLock:LogicalSchemaCache**  
A process modified the schema cache.

**LWLock:multixact\$1member**  
A process is waiting for I/O on a multixact\$1member buffer. 

**LWLock:multixact\$1offset**  
A process is waiting for I/O on a multixact offset buffer. 

**LWLock:MultiXactGen**  
A process is waiting to read or update shared multixact state. 

**LWLock:MultiXactGenLock**  
A process is waiting to read or update a shared multixact state. 

**LWLock:MultiXactMemberBuffer**  
A process is waiting for I/O on a simple least-recently used (SLRU) buffer for a multixact member. For more information, see [LWLock:MultiXact](apg-waits.lwlockmultixact.md). 

**LWLock:MultiXactMemberControlLock**  
A process is waiting to read or update multixact member mappings. 

**LWLock:MultiXactMemberSLRU**  
A process is waiting to access the simple least-recently used (SLRU) cache for a multixact member. For more information, see [LWLock:MultiXact](apg-waits.lwlockmultixact.md). 

**LWLock:MultiXactOffsetBuffer**  
A process is waiting for I/O on a simple least-recently used (SLRU) buffer for a multixact offset. For more information, see [LWLock:MultiXact](apg-waits.lwlockmultixact.md). 

**LWLock:MultiXactOffsetControlLock**  
A process is waiting to read or update multixact offset mappings. 

**LWLock:MultiXactOffsetSLRU**  
A process is waiting to access the simple least-recently used (SLRU) cache for a multixact offset. For more information, see [LWLock:MultiXact](apg-waits.lwlockmultixact.md). 

**LWLock:MultiXactTruncation**  
A process is waiting to read or truncate multixact information. 

**LWLock:MultiXactTruncationLock**  
A process is waiting to read or truncate multixact information. 

**LWLock:NotifyBuffer**  
A process is waiting for I/O on the simple least-recently used (SLRU) buffer for a NOTIFY message. 

**LWLock:NotifyQueue**  
A process is waiting to read or update NOTIFY messages.

**LWLock:NotifyQueueTail**  
A process is waiting to update a limit on NOTIFY message storage.

**LWLock:NotifyQueueTailLock**  
A process is waiting to update limit on notification message storage.

**LWLock:NotifySLRU**  
A process is waiting to access the simple least-recently used (SLRU) cache for a NOTIFY message.

**LWLock:OidGen**  
A process is waiting to allocate a new object ID (OID). 

**LWLock:OidGenLock**  
A process is waiting to allocate or assign an object ID (OID). 

**LWLock:oldserxid**  
A process is waiting for I/O on an oldserxid buffer. 

**LWLock:OldSerXidLock**  
A process is waiting to read or record conflicting serializable transactions.

**LWLock:OldSnapshotTimeMap**  
A process is waiting to read or update old snapshot control information.

**LWLock:OldSnapshotTimeMapLock**  
A process is waiting to read or update old snapshot control information.

**LWLock:parallel\$1append**  
A process is waiting to choose the next subplan during parallel append plan execution. 

**LWLock:parallel\$1hash\$1join**  
A process is waiting to allocate or exchange a chunk of memory or update counters during a parallel hash plan execution.

**LWLock:parallel\$1query\$1dsa**  
A process is waiting for a lock on dynamic shared memory allocation for a parallel query. 

**LWLock:ParallelAppend**  
A process is waiting to choose the next subplan during parallel append plan execution. 

**LWLock:ParallelHashJoin**  
A process is waiting to synchronize workers during plan execution for a parallel hash join. 

**Lwlock:ParallelQueryDSA**  
A process is waiting for dynamic shared memory allocation for a parallel query. 

**Lwlock:PerSessionDSA**  
A process is waiting for dynamic shared memory allocation for a parallel query. 

**Lwlock:PerSessionRecordType**  
A process is waiting to access a parallel query's information about composite types. 

**Lwlock:PerSessionRecordTypmod**  
A process is waiting to access a parallel query's information about type modifiers that identify anonymous record types. 

**Lwlock:PerXactPredicateList**  
A process is waiting to access the list of predicate locks held by the current serializable transaction during a parallel query. 

**Lwlock:predicate\$1lock\$1manager**  
A process is waiting to add or examine predicate lock information.

**Lwlock:PredicateLockManager**  
A process is waiting to access predicate lock information used by serializable transactions.

**Lwlock:proc**  
A process is waiting to read or update the fast-path lock information. 

**LWLock:ProcArray**  
A process is waiting to access the shared per-process data structures (typically, to get a snapshot or report a session's transaction ID). 

**LWLock:ProcArrayLock**  
A process is waiting to get a snapshot or clearing a transaction Id at a transaction's end. 

**LWLock:RelationMapping**  
A process is waiting to read or update a `pg_filenode.map` file (used to track the file-node assignments of certain system catalogs). 

**LWLock:RelationMappingLock**  
A process is waiting to update the relation map file used to store catalog-to-file-node mapping. 

**LWLock:RelCacheInit**  
A process is waiting to read or update a `pg_internal.init` file (a relation cache initialization file). 

**LWLock:RelCacheInitLock**  
A process is waiting to read or write a relation cache initialization file. 

**LWLock:replication\$1origin**  
A process is waiting to read or update the replication progress. 

**LWLock:replication\$1slot\$1io**  
A process is waiting for I/O on a replication slot. 

**LWLock:ReplicationOrigin**  
A process is waiting to create, drop, or use a replication origin.

**LWLock:ReplicationOriginLock**  
A process is waiting to set up, drop, or use a replication origin.

**LWLock:ReplicationOriginState**  
A process is waiting to read or update the progress of one replication origin. 

**LWLock:ReplicationSlotAllocation**  
A process is waiting to allocate or free a replication slot.

**LWLock:ReplicationSlotAllocationLock**  
A process is waiting to allocate or free a replication slot.

**LWLock:ReplicationSlotControl**  
A process is waiting to read or update a replication slot state.

**LWLock:ReplicationSlotControlLock**  
A process is waiting to read or update the replication slot state. 

**LWLock:ReplicationSlotIO**  
A process is waiting for I/O on a replication slot. 

**LWLock:SerialBuffer**  
A process is waiting for I/O on a simple least-recently used (SLRU) buffer for a serializable transaction conflict. 

**LWLock:SerializableFinishedList**  
A process is waiting to access the list of finished serializable transactions.

**LWLock:SerializableFinishedListLock**  
A process is waiting to access the list of finished serializable transactions.

**LWLock:SerializablePredicateList**  
A process is waiting to access the list of predicate locks held by serializable transactions.

**LWLock:SerializablePredicateLockListLock**  
A process is waiting to perform an operation on a list of locks held by serializable transactions. 

**LWLock:SerializableXactHash**  
A process is waiting to read or update information about serializable transactions. 

**LWLock:SerializableXactHashLock**  
A process is waiting to retrieve or store information about serializable transactions. 

**LWLock:SerialSLRU**  
A process is waiting to access the simple least-recently used (SLRU) cache for a serializable transaction conflict. 

**LWLock:SharedTidBitmap**  
A process is waiting to access a shared tuple identifier (TID) bitmap during a parallel bitmap index scan. 

**LWLock:SharedTupleStore**  
A process is waiting to access a shared tuple store during a parallel query. 

**LWLock:ShmemIndex**  
A process is waiting to find or allocate space in shared memory. 

**LWLock:ShmemIndexLock**  
A process is waiting to find or allocate space in shared memory. 

**LWLock:SInvalRead**  
A process is waiting to retrieve messages from the shared catalog invalidation queue. 

**LWLock:SInvalReadLock**  
A process is waiting to retrieve or remove messages from a shared invalidation queue. 

**LWLock:SInvalWrite**  
A process is waiting to add a message to the shared catalog invalidation queue. 

**LWLock:SInvalWriteLock**  
A process is waiting to add a message in a shared invalidation queue. 

**LWLock:SyncRep**  
A process is waiting to read or update information about the state of synchronous replication. 

**LWLock:SyncRepLock**  
A process is waiting to read or update information about synchronous replicas. 

**LWLock:SyncScan**  
A process is waiting to select the starting location of a synchronized table scan.

**LWLock:SyncScanLock**  
A process is waiting to get the start location of a scan on a table for synchronized scans.

**LWLock:TablespaceCreate**  
A process is waiting to create or drop a tablespace. 

**LWLock:TablespaceCreateLock**  
A process is waiting to create or drop the tablespace. 

**LWLock:tbm**  
A process is waiting for a shared iterator lock on a tree bitmap (TBM). 

**LWLock:TwoPhaseState**  
A process is waiting to read or update the state of prepared transactions. 

**LWLock:TwoPhaseStateLock**  
A process is waiting to read or update the state of prepared transactions. 

**LWLock:wal\$1insert**  
A process is waiting to insert the write-ahead log (WAL) into a memory buffer. 

**LWLock:WALBufMapping**  
A process is waiting to replace a page in write-ahead log (WAL) buffers. 

**LWLock:WALBufMappingLock**  
A process is waiting to replace a page in write-ahead log (WAL) buffers. 

**LWLock:WALInsert**  
A process is waiting to insert write-ahead log (WAL) data into a memory buffer. 

**LWLock:WALWrite**  
A process is waiting for write-ahead log (WAL) buffers to be written to disk. 

**LWLock:WALWriteLock**  
A process is waiting for write-ahead log (WAL) buffers to be written to disk. 

**LWLock:WrapLimitsVacuum**  
A process is waiting to update limits on transaction ID and multixact consumption. 

**LWLock:WrapLimitsVacuumLock**  
A process is waiting to update limits on transaction ID and multixact consumption. 

**LWLock:XactBuffer**  
A process is waiting for I/O on a simple least-recently used (SLRU) buffer for a transaction status. 

**LWLock:XactSLRU**  
A process is waiting to access the simple least-recently used (SLRU) cache for a transaction status. 

**LWLock:XactTruncation**  
A process is waiting to run pg\$1xact\$1status or update the oldest transaction ID available to it. 

**LWLock:XidGen**  
A process is waiting to allocate a new transaction ID.

**LWLock:XidGenLock**  
A process is waiting to allocate or assign a transaction ID. 

**Timeout:BaseBackupThrottle**  
A process is waiting during base backup when throttling activity. 

**Timeout:PgSleep**  
A backend process has called the pg\$1sleep function and is waiting for the sleep timeout to expire. For more information, see [Timeout:PgSleep](apg-waits.timeoutpgsleep.md).

**Timeout:RecoveryApplyDelay**  
A process is waiting to apply write-ahead log (WAL) during recovery because of a delay setting. 

**Timeout:RecoveryRetrieveRetryInterval**  
A process is waiting during recovery when write-ahead log (WAL) data is not available from any source (pg\$1wal, archive, or stream). 

**Timeout:VacuumDelay**  
A process is waiting in a cost-based vacuum delay point. 

For a complete list of PostgreSQL wait events, see [The Statistics Collector > Wait Event tables](https://www.postgresql.org/docs/current/monitoring-stats.html#WAIT-EVENT-TABLE) in the PostgreSQL documentation.