From 9fc63186054a14cf71dcb2a77d2a2397b2f93448 Mon Sep 17 00:00:00 2001 From: ldecarvalho-doc <82805470+ldecarvalho-doc@users.noreply.github.com> Date: Mon, 10 Nov 2025 14:28:36 +0100 Subject: [PATCH 1/8] fix(rdb): replication as pub --- .../logical-replication-as-publisher.mdx | 124 ++++++++++++++++++ .../logical-replication-as-subscriber.mdx | 6 + .../menu.ts | 4 + .../reference-content/pg-version-updates.mdx | 48 ++++++- 4 files changed, 175 insertions(+), 7 deletions(-) create mode 100644 pages/managed-databases-for-postgresql-and-mysql/api-cli/logical-replication-as-publisher.mdx diff --git a/pages/managed-databases-for-postgresql-and-mysql/api-cli/logical-replication-as-publisher.mdx b/pages/managed-databases-for-postgresql-and-mysql/api-cli/logical-replication-as-publisher.mdx new file mode 100644 index 0000000000..a199d6b978 --- /dev/null +++ b/pages/managed-databases-for-postgresql-and-mysql/api-cli/logical-replication-as-publisher.mdx @@ -0,0 +1,124 @@ +--- +title: Setting up logical replication as a publisher in PostgreSQL +description: Learn how to set up and use logical replication as a publisher in PostgreSQL +tags: postgresql logical replication publisher migration database +dates: + validation: 2025-08-25 + posted: 2025-02-20 +--- +import Requirements from '@macros/iam/requirements.mdx' + +The logical replication of databases as a publisher is available with [PostgreSQL 17](/managed-databases-for-postgresql-and-mysql/reference-content/pg-version-updates#postgresql-17), which is supported in Scaleway's Managed Databases for PostgreSQL. + +The feature allows you to replicate data from a managed PostgreSQL to another Database Instance (a Managed PostgreSQL in another region, for example). + +Replication slots can be created with the `failover` flag, which ensures that replication slots survive failovers. When a secondary node is promoted to primary, the replication slot is automatically available on the new main node. + + + +- A Scaleway account logged into the [console](https://console.scaleway.com) +- [Owner](/iam/concepts/#owner) status or [IAM permissions](/iam/concepts/#permission) allowing you to perform actions in the intended Organization +- A [Database Instance](/managed-databases-for-postgresql-and-mysql/how-to/create-a-database/) running PostgreSQL 17 + +## Configuring advanced settings and user rights + +As the service uses physical replication to provide High Availability, some parameters must be enabled to allow the logical replication to remain active after the promotion of a secondary node, without disturbing the HA setup. It is essential to ensure these setting are enabled as even Database Instances with in standalone mode can be replaced with temporary replicas. + +The [replication slot](https://www.postgresql.org/docs/17/logicaldecoding-explanation.html#LOGICALDECODING-REPLICATION-SLOTS) is an important part of the logical replication. Each subscription receives changes via one replication slot created on the "publishing" node. You have one replication slot available per logical database. + +To use replication, users must also have the corresponding rights. + +Follow the steps in the [How to configure advanced settings](/managed-databases-for-postgresql-and-mysql/how-to/configure-advanced-settings) documentation page to configure the following settings: + +To enable logical replication, you must: + +- Enable the `rdb.enable_logical_replication` setting. This automatically changes the `wal_level` settings to `logical`. +- Set `hot_standby_feedback` to `ON` +- Set `sync_replication_slots` to `ON` + +Follow the steps in the [How to manage users](/managed-databases-for-postgresql-and-mysql/how-to/manage-users) documentation page to attribute user rights. + +To create publications and replication slots, the `replication_user` must: + +- Either be an admin user (`rdb_admin`) +- Or be granted the following rights from an `rdb_admin`: + - `ALTER replication_user with REPLICATION` + - `GRANT CREATE ON DATABASE my_database TO my_replication_user;` + +## Setting up logical replication + +We use an example scenario to show how logical replication can be set up. + +1. Create the table and publication on the publisher database. + ```sql + CREATE TABLE mytable (id INTEGER PRIMARY KEY, val TEXT); + CREATE PUBLICATION pub FOR TABLE mytable; + ``` +2. Insert a sample row into the table. This ensures there's data to test the replication with. + ```sql + INSERT INTO mytable VALUES (1, 'foo'); + ``` +3. Create the same table structure on the subscriber database. Leave the table empty, as data will be copied into it upon subscription. + ```sql + CREATE TABLE mytable (id INTEGER PRIMARY KEY, val TEXT); + ``` +4. Create a subscription. Two methods are available: + - **Direct subscription with failover** - use this method if your environment supports the failover option in `CREATE SUBSCRIPTION` + - **Creating a replication slot manually on the publisher** - + + + + ```sql + CREATE SUBSCRIPTION sub CONNECTION 'host=myhost port=myport user=myuser dbname=mydb password=mypassword' PUBLICATION pub WITH (failover); + ``` + + + Some environments do not allow `CREATE SUBSCRIPTION` to auto-create slots due to permissions or configuration. In this case, you can create a slot with failover manually. + 1. Create a replication slot on the publisher database. + ```sql + SELECT pg_create_logical_replication_slot('sub', 'pgoutput', false, false, true); + ``` + + The last `true` in the command above enables the `failover` flag. + + 2. Create the subscription without creating a slot. + ```sql + CREATE SUBSCRIPTION sub CONNECTION 'host=myhost port=myport user=myuser dbname=mydb password=mypassword' PUBLICATION pub WITH (enabled=true, create_slot=false, slot_name='sub'); + ``` + + Refer to the [PostgreSQL documentation](https://www.postgresql.org/docs/current/functions-admin.html#FUNCTIONS-REPLICATION) for more information about `pg_create_logical_replication_slot()`. + + + + +5. Query the publisher table in the subscriber to test the replication. + ```sql + SELECT * FROM mytable; + ``` + +## Limitations + +- 100 replication slots are available for each Database Instance. +- 25 out of the 100 slots are reserved for Scaleway's internal systems. +- During the synchronization phase, 2 or more slots might be needed for a subscription. + + - If you need more than 50 replication slots, [create a support ticket](https://console.scaleway.com/support). + - If the limit is exceeded, your Managed Database service may become compromised. + + + + Run the following command to get a list of your replication slots: + ```sql + SELECT * FROM pg_replication_slots where slot_type = 'logical'; + ``` + And the following command to check publications: + ```sql + SELECT * from pg_publication; + ``` + + +- If a logical replication is not active but still consumed by a subscription or other tool, PostgreSQL WAL files will accumulate in the primary node, filling up storage. In the worst case scenario, your database can be set to read only mode (check disk full section). + + - We recommend you delete any replications that are no longer used. + - If a logical replication is inactive for 24h, it will be automatically removed. + diff --git a/pages/managed-databases-for-postgresql-and-mysql/api-cli/logical-replication-as-subscriber.mdx b/pages/managed-databases-for-postgresql-and-mysql/api-cli/logical-replication-as-subscriber.mdx index c72c195d38..6715288620 100644 --- a/pages/managed-databases-for-postgresql-and-mysql/api-cli/logical-replication-as-subscriber.mdx +++ b/pages/managed-databases-for-postgresql-and-mysql/api-cli/logical-replication-as-subscriber.mdx @@ -6,6 +6,7 @@ dates: validation: 2025-08-25 posted: 2025-02-20 --- +import Requirements from '@macros/iam/requirements.mdx' The logical replication of databases as a subscriber is available with [PostgreSQL 16](/managed-databases-for-postgresql-and-mysql/reference-content/pg-version-updates#postgresql-16), which is now supported in Scaleway's Managed Databases for PostgreSQL. @@ -23,6 +24,11 @@ By setting up the new database as a subscriber to the original database you can - **Flexible migration windows** - You can choose when to switch your application to the new database, without having to worry about data consistency. Logical replication ensures that the new database is always up-to-date with the latest changes in the original database. - **Easy rollback** - If you encounter issues during migration, such as data corruption and application issues, you can point your application back to the original database. Since the subscriber database constantly keeps a copy of the data in sync with the publisher, you can avoid data loss or inconsistencies. + + +- A Scaleway account logged into the [console](https://console.scaleway.com) +- [Owner](/iam/concepts/#owner) status or [IAM permissions](/iam/concepts/#permission) allowing you to perform actions in the intended Organization +- A [Database Instance](/managed-databases-for-postgresql-and-mysql/how-to/create-a-database/) running PostgreSQL 16 or a higher version ## How to set up the subscription diff --git a/pages/managed-databases-for-postgresql-and-mysql/menu.ts b/pages/managed-databases-for-postgresql-and-mysql/menu.ts index 3f4427fe18..acaab1b0bc 100644 --- a/pages/managed-databases-for-postgresql-and-mysql/menu.ts +++ b/pages/managed-databases-for-postgresql-and-mysql/menu.ts @@ -165,6 +165,10 @@ export const managedDatabasesForPostgresqlAndMysqlMenu = { label: 'Setting up logical replication as a subscriber', slug: 'logical-replication-as-subscriber', }, + { + label: 'Setting up logical replication as a publisher', + slug: 'logical-replication-as-publisher', + }, { label: 'Connecting Managed Databases to Kubernetes clusters', diff --git a/pages/managed-databases-for-postgresql-and-mysql/reference-content/pg-version-updates.mdx b/pages/managed-databases-for-postgresql-and-mysql/reference-content/pg-version-updates.mdx index 2b4a0efba1..c2ed183e0b 100644 --- a/pages/managed-databases-for-postgresql-and-mysql/reference-content/pg-version-updates.mdx +++ b/pages/managed-databases-for-postgresql-and-mysql/reference-content/pg-version-updates.mdx @@ -8,11 +8,45 @@ dates: This page lists updates for PostreSQL versions and their corresponding features that are supported at Scaleway. +## PostgreSQL 17 + +Find below the features and updates available with PostgreSQL 17. + +### Roles + +The `RDB` admin role can now assign the following predefined roles: + +| Role | Description | +| :--- | :--- | +| `pg_maintain` | Allows executing `VACUUM`, `ANALYZE`, `CLUSTER`, `REFRESH MATERIALIZED VIEW`, `REINDEX`, and `LOCK TABLE` on all relations, simulating `MAINTAIN` rights on those objects, even without having it explicitly. | + +### Features + +New features are available with PostgreSQL 17: + +- The logical [replication of databases as a publisher](/managed-databases-for-postgresql-and-mysql/api-cli/logical-replication-as-publisher) is now supported. + +### Extensions + +- **PostGIS** - [3.5](https://postgis.net/tags/3.5/) +- **Timescale** - [2.2](https://github.com/timescale/timescaledb/releases/tag/2.21.4) +- **pgRouting** - [3.7.3](https://github.com/pgRouting/pgrouting/releases/tag/v3.7.3) +- **pgvector** - [0.8.1](https://github.com/pgvector/pgvector/releases/tag/v0.8.1) +- **H3 PG** - [4.2.3](https://github.com/zachasme/h3-pg/releases/tag/v4.2.3) + +### Advanced settings + +These are the new advanced settings available with PostgreSQL 17: + +- `allow_alter_system` + +Refer to the official [Server configuration](https://www.postgresql.org/docs/17/runtime-config-compatible.html) PostgreSQL documentation for more information. + ## PostgreSQL 16 Find below the new features and updates available with PostgreSQL 16. -## Roles +### Roles The `RDB` admin role can now assign the following predefined roles: @@ -32,7 +66,7 @@ The `RDB` admin role can now assign the following predefined roles: Refer to the official [Predefined Roles](https://www.postgresql.org/docs/16/predefined-roles.html) PostgreSQL documentation for a more detailed description of the roles above. -## Features +### Features New features are available with PostgreSQL 16: @@ -40,7 +74,7 @@ New features are available with PostgreSQL 16: - Passwords are now encrypted using the `SCRAM-SHA-256` setting. If you upgrade your engine and are currently using MD5, you also have to migrate to SCRAM-SHA-256. Refer to the official [Password Authentication](https://www.postgresql.org/docs/current/auth-password.html#AUTH-PASSWORD) PostgreSQL documentation to learn how to do so. - Support of the Timescale [pre-restore](https://docs.timescale.com/api/latest/administration/#timescaledb_pre_restore) and [post-restore](https://docs.timescale.com/api/latest/administration/#timescaledb_post_restore) features. They allow you to restore the database using `pg_restore`. -## Extensions +### Extensions The following extensions were also upgraded. @@ -51,11 +85,11 @@ The following extensions were also upgraded. - **pgvector** - [0.8.0](https://github.com/pgvector/pgvector/releases/tag/v0.8.0) - **H3 PG** - [4.1.4](https://github.com/zachasme/h3-pg/releases/tag/v4.1.4) -## Advanced settings +### Advanced settings These are the new advanced settings available with PostgreSQL 16: -### Autovaccum +#### Autovaccum - `autovacuum_vacuum_insert_scale_factor` - `autovacuum_vacuum_insert_threshold` @@ -64,7 +98,7 @@ These are the new advanced settings available with PostgreSQL 16: Refer to the official [Autovaccum](https://www.postgresql.org/docs/16/routine-vacuuming.html#AUTOVACUUM) PostgreSQL documentation for more information. -### Error reporting and logging +#### Error reporting and logging - `cron.timezone` - `log_checkpoints` @@ -75,7 +109,7 @@ Refer to the official [Autovaccum](https://www.postgresql.org/docs/16/routine-va Refer to the official [Error reporting and logging](https://www.postgresql.org/docs/16/runtime-config-logging.html) PostgreSQL documentation for more information. -### PG stats parameters +#### PG stats parameters - `pg_stat_statements.max` - `pg_stat_statements.track` From 8e5babdf378510d7b8536681de8536e33bb12f4d Mon Sep 17 00:00:00 2001 From: ldecarvalho-doc <82805470+ldecarvalho-doc@users.noreply.github.com> Date: Mon, 10 Nov 2025 15:59:12 +0100 Subject: [PATCH 2/8] fix(rdb): review hugo Co-authored-by: Hugo DUBOIS <89007116+Uyoooo@users.noreply.github.com> --- .../api-cli/logical-replication-as-publisher.mdx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/pages/managed-databases-for-postgresql-and-mysql/api-cli/logical-replication-as-publisher.mdx b/pages/managed-databases-for-postgresql-and-mysql/api-cli/logical-replication-as-publisher.mdx index a199d6b978..88a213c308 100644 --- a/pages/managed-databases-for-postgresql-and-mysql/api-cli/logical-replication-as-publisher.mdx +++ b/pages/managed-databases-for-postgresql-and-mysql/api-cli/logical-replication-as-publisher.mdx @@ -1,7 +1,7 @@ --- title: Setting up logical replication as a publisher in PostgreSQL description: Learn how to set up and use logical replication as a publisher in PostgreSQL -tags: postgresql logical replication publisher migration database +tags: postgresql logical replication publisher publication database dates: validation: 2025-08-25 posted: 2025-02-20 @@ -40,8 +40,8 @@ Follow the steps in the [How to manage users](/managed-databases-for-postgresql- To create publications and replication slots, the `replication_user` must: -- Either be an admin user (`rdb_admin`) -- Or be granted the following rights from an `rdb_admin`: +- Either be an member of admin user role (`_rdb_admin`) +- Or be granted the following rights from a role member of the`_rdb_admin` role: - `ALTER replication_user with REPLICATION` - `GRANT CREATE ON DATABASE my_database TO my_replication_user;` @@ -117,8 +117,8 @@ We use an example scenario to show how logical replication can be set up. ``` -- If a logical replication is not active but still consumed by a subscription or other tool, PostgreSQL WAL files will accumulate in the primary node, filling up storage. In the worst case scenario, your database can be set to read only mode (check disk full section). +- If a logical replication is not active (not consumed by a subscription or other tool), PostgreSQL WAL files will accumulate in the primary node, filling up storage. In the worst case scenario, your database can be set to read only mode (check disk full section) or unavailable. - - We recommend you delete any replications that are no longer used. + - We recommend you delete any replication slots that are no longer used. - If a logical replication is inactive for 24h, it will be automatically removed. From 1472757a6c6c775e48a1eea816779dac5b437066 Mon Sep 17 00:00:00 2001 From: ldecarvalho-doc <82805470+ldecarvalho-doc@users.noreply.github.com> Date: Mon, 10 Nov 2025 16:16:17 +0100 Subject: [PATCH 3/8] fix(rdb): reviews --- .../logical-replication-as-publisher.mdx | 20 ++++++++++--------- .../reference-content/pg-version-updates.mdx | 5 +++-- 2 files changed, 14 insertions(+), 11 deletions(-) diff --git a/pages/managed-databases-for-postgresql-and-mysql/api-cli/logical-replication-as-publisher.mdx b/pages/managed-databases-for-postgresql-and-mysql/api-cli/logical-replication-as-publisher.mdx index 88a213c308..a1c8309370 100644 --- a/pages/managed-databases-for-postgresql-and-mysql/api-cli/logical-replication-as-publisher.mdx +++ b/pages/managed-databases-for-postgresql-and-mysql/api-cli/logical-replication-as-publisher.mdx @@ -1,7 +1,7 @@ --- title: Setting up logical replication as a publisher in PostgreSQL description: Learn how to set up and use logical replication as a publisher in PostgreSQL -tags: postgresql logical replication publisher publication database +tags: postgresql logical replication publisher publication database dates: validation: 2025-08-25 posted: 2025-02-20 @@ -22,11 +22,7 @@ Replication slots can be created with the `failover` flag, which ensures that re ## Configuring advanced settings and user rights -As the service uses physical replication to provide High Availability, some parameters must be enabled to allow the logical replication to remain active after the promotion of a secondary node, without disturbing the HA setup. It is essential to ensure these setting are enabled as even Database Instances with in standalone mode can be replaced with temporary replicas. - -The [replication slot](https://www.postgresql.org/docs/17/logicaldecoding-explanation.html#LOGICALDECODING-REPLICATION-SLOTS) is an important part of the logical replication. Each subscription receives changes via one replication slot created on the "publishing" node. You have one replication slot available per logical database. - -To use replication, users must also have the corresponding rights. +As the service uses physical replication to provide High Availability, some advanced settings must be enabled to allow the logical replication to remain active after the promotion of a secondary node, without disturbing the HA setup. It is essential to ensure these settings are enabled as even Database Instances with in standalone mode can be replaced with temporary replicas. Follow the steps in the [How to configure advanced settings](/managed-databases-for-postgresql-and-mysql/how-to/configure-advanced-settings) documentation page to configure the following settings: @@ -34,7 +30,9 @@ To enable logical replication, you must: - Enable the `rdb.enable_logical_replication` setting. This automatically changes the `wal_level` settings to `logical`. - Set `hot_standby_feedback` to `ON` -- Set `sync_replication_slots` to `ON` +- Set `sync_replication_slots` to `ON`- [replication slots](https://www.postgresql.org/docs/17/logicaldecoding-explanation.html#LOGICALDECODING-REPLICATION-SLOTS) is an important part of the logical replication. Each subscription receives changes via one replication slot created on the "publishing" node. You have one replication slot available per logical database. + +To use replication, users must also have the corresponding rights. Follow the steps in the [How to manage users](/managed-databases-for-postgresql-and-mysql/how-to/manage-users) documentation page to attribute user rights. @@ -86,7 +84,7 @@ We use an example scenario to show how logical replication can be set up. CREATE SUBSCRIPTION sub CONNECTION 'host=myhost port=myport user=myuser dbname=mydb password=mypassword' PUBLICATION pub WITH (enabled=true, create_slot=false, slot_name='sub'); ``` - Refer to the [PostgreSQL documentation](https://www.postgresql.org/docs/current/functions-admin.html#FUNCTIONS-REPLICATION) for more information about `pg_create_logical_replication_slot()`. + Refer to the official [PostgreSQL documentation](https://www.postgresql.org/docs/current/functions-admin.html#FUNCTIONS-REPLICATION) for more information about `pg_create_logical_replication_slot()`. @@ -96,6 +94,10 @@ We use an example scenario to show how logical replication can be set up. SELECT * FROM mytable; ``` + + Refer to the official [PostgreSQL documentation](https://www.postgresql.org/docs/current/logical-replication.html) for more information about logical replication. + + ## Limitations - 100 replication slots are available for each Database Instance. @@ -103,7 +105,7 @@ We use an example scenario to show how logical replication can be set up. - During the synchronization phase, 2 or more slots might be needed for a subscription. - If you need more than 50 replication slots, [create a support ticket](https://console.scaleway.com/support). - - If the limit is exceeded, your Managed Database service may become compromised. + - Exceeding this limit may cause the Instance's internal replication to fail. diff --git a/pages/managed-databases-for-postgresql-and-mysql/reference-content/pg-version-updates.mdx b/pages/managed-databases-for-postgresql-and-mysql/reference-content/pg-version-updates.mdx index c2ed183e0b..daefcea6e0 100644 --- a/pages/managed-databases-for-postgresql-and-mysql/reference-content/pg-version-updates.mdx +++ b/pages/managed-databases-for-postgresql-and-mysql/reference-content/pg-version-updates.mdx @@ -29,7 +29,7 @@ New features are available with PostgreSQL 17: ### Extensions - **PostGIS** - [3.5](https://postgis.net/tags/3.5/) -- **Timescale** - [2.2](https://github.com/timescale/timescaledb/releases/tag/2.21.4) +- **Timescale** - [2.2](https://github.com/timescale/timescaledb/releases/tag/2.22.1) - **pgRouting** - [3.7.3](https://github.com/pgRouting/pgrouting/releases/tag/v3.7.3) - **pgvector** - [0.8.1](https://github.com/pgvector/pgvector/releases/tag/v0.8.1) - **H3 PG** - [4.2.3](https://github.com/zachasme/h3-pg/releases/tag/v4.2.3) @@ -38,7 +38,8 @@ New features are available with PostgreSQL 17: These are the new advanced settings available with PostgreSQL 17: -- `allow_alter_system` +- `rdb.enable_logical_replication` +- `sync_replication_slots` Refer to the official [Server configuration](https://www.postgresql.org/docs/17/runtime-config-compatible.html) PostgreSQL documentation for more information. From 7b6e25b9142d498e4a1efb34aa5076352b7740f8 Mon Sep 17 00:00:00 2001 From: ldecarvalho-doc <82805470+ldecarvalho-doc@users.noreply.github.com> Date: Mon, 10 Nov 2025 16:21:08 +0100 Subject: [PATCH 4/8] fix(rdb): reviews 2 --- .../reference-content/pg-version-updates.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pages/managed-databases-for-postgresql-and-mysql/reference-content/pg-version-updates.mdx b/pages/managed-databases-for-postgresql-and-mysql/reference-content/pg-version-updates.mdx index daefcea6e0..fa1314ec6a 100644 --- a/pages/managed-databases-for-postgresql-and-mysql/reference-content/pg-version-updates.mdx +++ b/pages/managed-databases-for-postgresql-and-mysql/reference-content/pg-version-updates.mdx @@ -28,7 +28,7 @@ New features are available with PostgreSQL 17: ### Extensions -- **PostGIS** - [3.5](https://postgis.net/tags/3.5/) +- **PostGIS** - 3.14 and [3.5](https://postgis.net/tags/3.5/) - **Timescale** - [2.2](https://github.com/timescale/timescaledb/releases/tag/2.22.1) - **pgRouting** - [3.7.3](https://github.com/pgRouting/pgrouting/releases/tag/v3.7.3) - **pgvector** - [0.8.1](https://github.com/pgvector/pgvector/releases/tag/v0.8.1) From 40453293484c4f5aa55aa2f5e2b64b07612700a0 Mon Sep 17 00:00:00 2001 From: ldecarvalho-doc <82805470+ldecarvalho-doc@users.noreply.github.com> Date: Mon, 10 Nov 2025 16:59:37 +0100 Subject: [PATCH 5/8] fix(rdb): reviews 3 --- .../api-cli/logical-replication-as-publisher.mdx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/pages/managed-databases-for-postgresql-and-mysql/api-cli/logical-replication-as-publisher.mdx b/pages/managed-databases-for-postgresql-and-mysql/api-cli/logical-replication-as-publisher.mdx index a1c8309370..525be5b007 100644 --- a/pages/managed-databases-for-postgresql-and-mysql/api-cli/logical-replication-as-publisher.mdx +++ b/pages/managed-databases-for-postgresql-and-mysql/api-cli/logical-replication-as-publisher.mdx @@ -22,7 +22,7 @@ Replication slots can be created with the `failover` flag, which ensures that re ## Configuring advanced settings and user rights -As the service uses physical replication to provide High Availability, some advanced settings must be enabled to allow the logical replication to remain active after the promotion of a secondary node, without disturbing the HA setup. It is essential to ensure these settings are enabled as even Database Instances with in standalone mode can be replaced with temporary replicas. +As the service uses physical replication internally, some advanced settings and parameters must be enabled to allow the logical replication to work properly with our system, for standalone and High Availability clusters. Follow the steps in the [How to configure advanced settings](/managed-databases-for-postgresql-and-mysql/how-to/configure-advanced-settings) documentation page to configure the following settings: @@ -32,6 +32,11 @@ To enable logical replication, you must: - Set `hot_standby_feedback` to `ON` - Set `sync_replication_slots` to `ON`- [replication slots](https://www.postgresql.org/docs/17/logicaldecoding-explanation.html#LOGICALDECODING-REPLICATION-SLOTS) is an important part of the logical replication. Each subscription receives changes via one replication slot created on the "publishing" node. You have one replication slot available per logical database. + + It is essential to set these parameters when using logical replication to ensure service availability. + + + To use replication, users must also have the corresponding rights. Follow the steps in the [How to manage users](/managed-databases-for-postgresql-and-mysql/how-to/manage-users) documentation page to attribute user rights. From 77cc5679d8e234a1585df1dc15a72832b52dbfd0 Mon Sep 17 00:00:00 2001 From: ldecarvalho-doc <82805470+ldecarvalho-doc@users.noreply.github.com> Date: Wed, 12 Nov 2025 15:56:15 +0100 Subject: [PATCH 6/8] fix(rdb): reviews Co-authored-by: Rowena Jones <36301604+RoRoJ@users.noreply.github.com> --- .../api-cli/logical-replication-as-publisher.mdx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pages/managed-databases-for-postgresql-and-mysql/api-cli/logical-replication-as-publisher.mdx b/pages/managed-databases-for-postgresql-and-mysql/api-cli/logical-replication-as-publisher.mdx index 525be5b007..ecfa175fb7 100644 --- a/pages/managed-databases-for-postgresql-and-mysql/api-cli/logical-replication-as-publisher.mdx +++ b/pages/managed-databases-for-postgresql-and-mysql/api-cli/logical-replication-as-publisher.mdx @@ -36,7 +36,6 @@ To enable logical replication, you must: It is essential to set these parameters when using logical replication to ensure service availability. - To use replication, users must also have the corresponding rights. Follow the steps in the [How to manage users](/managed-databases-for-postgresql-and-mysql/how-to/manage-users) documentation page to attribute user rights. @@ -57,7 +56,7 @@ We use an example scenario to show how logical replication can be set up. CREATE TABLE mytable (id INTEGER PRIMARY KEY, val TEXT); CREATE PUBLICATION pub FOR TABLE mytable; ``` -2. Insert a sample row into the table. This ensures there's data to test the replication with. +2. Insert a sample row into the table. This ensures that there is data to test the replication with. ```sql INSERT INTO mytable VALUES (1, 'foo'); ``` From 91d822643ecaf1071f374256aa65998fedb6b713 Mon Sep 17 00:00:00 2001 From: ldecarvalho-doc <82805470+ldecarvalho-doc@users.noreply.github.com> Date: Wed, 12 Nov 2025 16:00:39 +0100 Subject: [PATCH 7/8] fix(rdb): reviews final --- .../api-cli/logical-replication-as-publisher.mdx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pages/managed-databases-for-postgresql-and-mysql/api-cli/logical-replication-as-publisher.mdx b/pages/managed-databases-for-postgresql-and-mysql/api-cli/logical-replication-as-publisher.mdx index ecfa175fb7..4b5abdc785 100644 --- a/pages/managed-databases-for-postgresql-and-mysql/api-cli/logical-replication-as-publisher.mdx +++ b/pages/managed-databases-for-postgresql-and-mysql/api-cli/logical-replication-as-publisher.mdx @@ -33,7 +33,7 @@ To enable logical replication, you must: - Set `sync_replication_slots` to `ON`- [replication slots](https://www.postgresql.org/docs/17/logicaldecoding-explanation.html#LOGICALDECODING-REPLICATION-SLOTS) is an important part of the logical replication. Each subscription receives changes via one replication slot created on the "publishing" node. You have one replication slot available per logical database. - It is essential to set these parameters when using logical replication to ensure service availability. + As the service uses physical replication to provide High Availability, the `hot_standby_feedback` and `sync_replication_slots` parameters must be enabled to allow the logical replication to remain active after the promotion of a secondary node, without disturbing the HA setup. It is essential to ensure these settings are enabled as even a Database Instance in standalone mode can be replaced with temporary replicas. To use replication, users must also have the corresponding rights. @@ -109,7 +109,7 @@ We use an example scenario to show how logical replication can be set up. - During the synchronization phase, 2 or more slots might be needed for a subscription. - If you need more than 50 replication slots, [create a support ticket](https://console.scaleway.com/support). - - Exceeding this limit may cause the Instance's internal replication to fail. + - Exceeding this limit may cause the Instance's internal replication to fail. High Availability and cluster operations may also become degraded or not functional. In extreme cases, service availability may be affected. From 55669a1a792bb91b6cdd92737b839417e098e68a Mon Sep 17 00:00:00 2001 From: ldecarvalho-doc <82805470+ldecarvalho-doc@users.noreply.github.com> Date: Wed, 12 Nov 2025 16:08:02 +0100 Subject: [PATCH 8/8] fix(rdb): add info --- .../how-to/create-a-database.mdx | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pages/managed-databases-for-postgresql-and-mysql/how-to/create-a-database.mdx b/pages/managed-databases-for-postgresql-and-mysql/how-to/create-a-database.mdx index 570cb1016e..f42d49559b 100644 --- a/pages/managed-databases-for-postgresql-and-mysql/how-to/create-a-database.mdx +++ b/pages/managed-databases-for-postgresql-and-mysql/how-to/create-a-database.mdx @@ -68,6 +68,11 @@ Compared to traditional database management, which requires customers to provide You can restore the data contained in a snapshot to a Database Instance. When you do so, a new Database Instance is created and billed to your account. + + Keep in mind that replication slots cannot be restored when using PostgreSQL. + + + 1. Go to the **Snapshots** tab of your Database Instance of choice. 2. Click the next to the name of the snapshot. 3. Click **Create Database Instance from snapshot**. A pop-up appears.