Initializing the pgactive extension capability
To initialize the pgactive
extension capability on your RDS for PostgreSQL DB
instance, set the value of the rds.enable_pgactive
parameter to 1
and then create the extension in the database. Doing so automatically turns on the parameters
rds.logical_replication
and track_commit_timestamp
and sets the
value of wal_level
to logical
.
You must have permissions as the rds_superuser
role to perform these
tasks.
You can use the AWS Management Console or the AWS CLI to create the required RDS for PostgreSQL DB instances. The steps following assume that your RDS for PostgreSQL DB instance is associated with a custom DB parameter group. For information about creating a custom DB parameter group, see Parameter groups for Amazon RDS.
To initialize the pgactive extension capability
Sign in to the AWS Management Console and open the Amazon RDS console at https://console.aws.amazon.com/rds/
. -
In the navigation pane, choose your RDS for PostgreSQL DB instance.
-
Open the Configuration tab for your RDS for PostgreSQL DB instance. In the instance details, find the DB instance parameter group link.
-
Choose the link to open the custom parameters associated with your RDS for PostgreSQL DB instance.
-
Find the
rds.enable_pgactive
parameter, and set it to1
to initialize thepgactive
capability. -
Choose Save changes.
-
In the navigation pane of the Amazon RDS console, choose Databases.
-
Select your RDS for PostgreSQL DB instance, and then choose Reboot from the Actions menu.
-
Confirm the DB instance reboot so that your changes take effect.
-
When the DB instance is available, you can use
psql
or any other PostgreSQL client to connect to the RDS for PostgreSQL DB instance.The following example assumes that your RDS for PostgreSQL DB instance has a default database named
postgres
.psql --host=
mydb.111122223333
.aws-region
.rds.amazonaws.com --port=5432 --username=postgres
--password=PASSWORD
--dbname=postgres
-
To verify that pgactive is initialized, run the following command.
postgres=>
SELECT setting ~ 'pgactive' FROM pg_catalog.pg_settings WHERE name = 'shared_preload_libraries';
If
pgactive
is inshared_preload_libraries
, the preceding command will return the following:?column? ---------- t
To initialize the pgactive extension capability
To initialize the pgactive
using the AWS CLI, call the modify-db-parameter-group operation to modify certain parameters in your
custom parameter group as shown in the following procedure.
-
Use the following AWS CLI command to set
rds.enable_pgactive
to1
to initialize thepgactive
capability for the RDS for PostgreSQL DB instance.postgres=>
aws rds modify-db-parameter-group \ --db-parameter-group-namecustom-param-group-name
\ --parameters "ParameterName=rds.enable_pgactive,ParameterValue=1,ApplyMethod=pending-reboot" \ --regionaws-region
-
Use the following AWS CLI command to reboot the RDS for PostgreSQL DB instance so that the
pgactive
library is initialized.aws rds reboot-db-instance \ --db-instance-identifier
your-instance
\ --regionaws-region
-
When the instance is available, use
psql
to connect to the RDS for PostgreSQL DB instance.psql --host=
mydb.111122223333
.aws-region
.rds.amazonaws.com --port=5432 --username=master user
--password=PASSWORD
--dbname=postgres
-
To verify that pgactive is initialized, run the following command.
postgres=>
SELECT setting ~ 'pgactive' FROM pg_catalog.pg_settings WHERE name = 'shared_preload_libraries';
If
pgactive
is inshared_preload_libraries
, the preceding command will return the following:?column? ---------- t