0 / 0
Replicating Amazon RDS for PostgreSQL data

Replicating Amazon RDS for PostgreSQL data

You can replicate data from Amazon RDS for PostgreSQL to other databases with Data Replication.

To set up replication for PostgreSQL, first configure your Amazon RDS for PostgreSQL service, and then add a connection to it in a project.

Restrictions

  • You can use this connection only as a source for Data Replication. You cannot use this connection as a target connection.
  • You can replicate only some PostgreSQL data types. See Supported PostgreSQL data types.

Supported versions

PostgreSQL database versions 10, 11 and 12

Configuring the PostgreSQL database for replication

To set up PostgreSQL in your Amazon account:

  1. Check that your Amazon RDS for PostgreSQL database instance has the proper privileges for replication. Using a database client, run the following query.

    SELECT setting FROM pg_settings WHERE NAME='rds.logical_replication';	
    
    Note: Do not alter the replica identity for schemas and tables you are replicating. Data Replication will stop if you modify the replica identity to be less than full.
  2. Create a DB parameter group. Confirm that you have an existing parameter group named default.postgresversion. Create a new parameter group, selecting parameter group family postgresversion, where version matches the existing parameter group version.

  3. If your PostgreSQL database instance has the proper privileges, the Setting column will have value on, and you can skip to the next section. If the value is not on, modify the database parameters to enable replication.

  4. Associate a DB parameter group with your database instance.

  5. Modify parameters in the DB parameter group

    1. Set rds.logical_replication to 1. This enables logical replication.
    2. Set max_replication_slots and max_wal_sender to the number of concurrent Data Replication assets you want to run.
    3. Save the changes.
  6. Apply the changes. Open the RDS console, in the navigation pane select Databases, select your database instance. From the Actions menu, select Reboot.

  7. Grant access to connections from IBM Cloud. Many Amazon RDS for PostgreSQL database instances have Public access but do not allow connections from IBM Cloud. To grant access for IBM Cloud to connect to the database:

    1. Open the RDS console. In the navigation pane select Databases, select your database instance, and click Connectivity & security.
    2. Under heading VPC security groups, click the link for the active security group.
    3. Scroll down and click Edit inbound rules.
    4. Click Add rule. Select type PostgreSQL and source Anywhere.
    5. Click Save rules. This will also modify the Outbound rules.
  8. Grant roles to the database username. Ask your database administrator to grant the roles rds_superuser and rds_replication to the username you use in the connection for Data Replication.

Connecting to Amazon RDS for PostgreSQL in a project

To connect to Amazon RDS for PostgreSQL in a project in Cloud Pak for Data as a Service, see Amazon RDS for PostgreSQL connection.

Next step

Starting Data Replication

Learn more

Parent topic: Supported Data Replication connections

Generative AI search and answer
These answers are generated by a large language model in watsonx.ai based on content from the product documentation. Learn more