Azure postgre sql mirroring does not install cdc extension in one of the db

Gediminas 20 Reputation points
2025-08-25T10:48:25.8733333+00:00

Mirroring on the postgresql db does not install cdc extension which does not allow mirroring to be enabled

in default db named postgres it isntalls but in our other db it does not. Anyone have an idea why it can be like this ? We using the preview function and doing everythign what it says in microsoft learn

Azure Database for PostgreSQL
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Amira Bedhiafi 36,716 Reputation points Volunteer Moderator
    2025-08-25T12:12:20.28+00:00

    Hello Gediminas !

    Thank you for posting on Microsoft Learn.

    The CDC bit isn’t global as Fabric mirroring preview adds the azure_cdc extension per database, and only for the databases you select in the Azure portal mirroring enablement flow. If it shows up in postgres but not in your user DB, it usually means that DB wasn’t included (or your server doesn’t meet a preview limitation), so the extension wasn’t registered there.

    On the same flexible server:

    • PostgreSQL version must be 14–17
    • Compute tier must not be burstable (GP/MO only)
    • High availability must be off.
    • No read replicas (and not a primary that has replicas).

    If any of these are true, the mirroring workflow will skip registering azure_cdc in your DB. https://learn.microsoft.com/en-us/fabric/database/mirrored-database/azure-database-postgresql-limitations

    You can rerun the mirroring enablement flow and include the right DB

    In the Azure portal, go to your Azure Database for PostgreSQL Flexible Server under Fabric mirroring (preview) then Get started:

    • The page checks prerequisites and lets you select which databases to enable.
    • Select your user DB (not just postgres) then click prepare then accept the restart.

    This flow preloads and registers azure_cdc only for the selected databases and bumps needed server params. https://learn.microsoft.com/en-us/azure/postgresql/flexible-server/concepts-fabric-mirroring

    By default you can mirror up to 3 databases per server. If you need more, increase azure_cdc.max_fabric_mirrors on the server first, then rerun the flow.

    https://learn.microsoft.com/en-us/azure/postgresql/flexible-server/concepts-fabric-mirroring

    You can check if the extension is registered in that specific database:

    -- Is the extension even available on the server?
    SELECT * FROM pg_available_extensions WHERE name = 'azure_cdc';
    
    -- Is it installed in THIS database?
    SELECT * FROM pg_extension WHERE extname = 'azure_cdc';
    
    -- Did the workflow set logical WAL?
    SHOW wal_level;
    

    If pg_extension returns no row for azure_cdc in your DB, it wasn’t registered there then go back to step 2.

    Once installed, you’ll also see the azure_cdc schema and can use the troubleshooting UDFs like azure_cdc.tracked_publications() and azure_cdc.tracked_batches().

    1 person found this answer helpful.

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.