cancel
Showing results forย 
Search instead forย 
Did you mean:ย 
Data Engineering
Join discussions on data engineering best practices, architectures, and optimization strategies within the Databricks Community. Exchange insights and solutions with fellow data engineers.
cancel
Showing results forย 
Search instead forย 
Did you mean:ย 

Request for Guidance: Enabling PostgreSQL CDC in Azure Databricks Lakeflow Connect

Pravieen
New Contributor II

Hello Databricks Community,

I am using Azure Databricks Lakeflow Connect with a PostgreSQL source.

The CDC option is disabled in the PostgreSQL ingestion wizard, and I see the following message:

This mode is not available in this workspace for the selected connector.

Could someone clarify how to enable PostgreSQL CDC Public Preview in an Azure Databricks workspace?

I have already raised a support ticket (#01072097).

Thank you.

3 REPLIES 3

VladTamas
Contributor

Short answer: you can't switch this on from the wizard or a workspace setting. The Azure docs say the PostgreSQL connector is in Public Preview and that you request access through your Azure Databricks account team [1]. "This mode is not available in this workspace for the selected connector" means the preview isn't enabled for your workspace yet. Your support ticket is fine, but also ping your account team (or ask support to route it to them), and include the workspace ID and region.

While you wait, get the PostgreSQL side ready. Then the pipeline works on the first try once access lands.

1. Turn on logical replication

The connector reads changes through logical replication, PostgreSQL 13 or later [2].

SHOW wal_level;   -- must return: logical

On Azure Database for PostgreSQL Flexible Server, set wal_level = logical in Server parameters (portal or CLI) and restart the server. Also open the firewall to your Databricks workspace [2].

2. Create the replication user, publication and slot

CREATE USER databricks_replication WITH PASSWORD '<secret>';
GRANT CONNECT ON DATABASE your_db TO databricks_replication;
GRANT USAGE ON SCHEMA your_schema TO databricks_replication;
GRANT SELECT ON TABLE your_schema.your_table TO databricks_replication;
ALTER USER databricks_replication WITH REPLICATION;

-- as the table owner, not the replication user
CREATE PUBLICATION databricks_publication FOR TABLE your_schema.your_table;

-- the slot must be created BY the replication user, pgoutput only
SET ROLE databricks_replication;
SELECT pg_create_logical_replication_slot('databricks_slot', 'pgoutput');
RESET ROLE;
 

Order matters: create the publication first, then the slot [2]. You need one publication and one slot per database.

3. Don't skip the WAL limits

Set max_slot_wal_keep_size to a finite value; the default -1 lets an idle slot grow WAL without limit. Make sure max_replication_slots and max_wal_senders cover the new slot [2]. If you delete the pipeline later, drop the slot by hand.

4. Check before you retry the wizard

SHOW wal_level;
SELECT rolname, rolreplication FROM pg_roles WHERE rolname = 'databricks_replication';
SELECT * FROM pg_publication WHERE pubname = 'databricks_publication';
 

What I'd do

Ask the account team for PostgreSQL connector preview access on that workspace. In parallel, finish steps 1โ€“4. Once it is enabled, create the connection with the replication user's credentials and retry the wizard [3].

Note: I couldn't test this end-to-end because I don't have a PostgreSQL source wired to a workspace with the preview. Everything above comes from the current Azure docs.

References

[1] PostgreSQL ingestion connector | Azure Databricks โ€” https://learn.microsoft.com/en-us/azure/databricks/ingestion/lakeflow-connect/postgresql 

[2] Configure PostgreSQL for ingestion into Azure Databricks โ€” https://learn.microsoft.com/en-us/azure/databricks/ingestion/lakeflow-connect/postgresql-source-setu... 

[3] Create a PostgreSQL connection | Azure Databricks โ€” https://learn.microsoft.com/en-us/azure/databricks/ingestion/lakeflow-connect/postgresql-connection

saurabh18cs
Esteemed Contributor

anuj_lathi
Databricks Employee
Databricks Employee

The message means that CDC mode for the PostgreSQL connector isn't turned on for your workspace. It isn't a problem with your connection or source configuration. Since you already have a ticket open, that's the right path, but there are a couple of things you can check in the meantime.

1. Check the Previews page (workspace admin)

Many Public Preview features are opt-in per workspace. A workspace admin can find them by clicking their username in the top bar, then Settings, then the Previews page [1]. Look for anything related to Lakeflow Connect, the PostgreSQL connector, or database CDC and turn it on if it's listed. You need workspace admin rights to see and change this.

2. If there's no toggle, it's gated on the Databricks side

If nothing relevant is listed, the connector's CDC mode is allowlisted per workspace. A workspace admin can't enable it from the UI in that case, and Databricks has to enable it for your workspace. Here's how I'd speed that up:

  • Give your Databricks account team (or the support engineer on ticket #01072097) your workspace ID, workspace URL, and Azure region, and state explicitly that you want PostgreSQL CDC enabled.
  • Confirm the workspace is in a region where the feature is available. Preview features often roll out region by region, so an unsupported region will show the same disabled state.

3. Rule out the usual prerequisites

Even once the option is enabled, the wizard expects the standard Lakeflow Connect setup:

  • The workspace is enabled for Unity Catalog, and you have the privileges to create a connection and a destination catalog and schema.
  • Serverless compute is available in the workspace, because managed ingestion pipelines run on it.
  • The PostgreSQL source is set up for logical-replication-based CDC. That means logical replication enabled on the server, plus a replication-capable user, so check this with your DBA before you retry.

Next step: Check Settings โ†’ Previews first, since that's the only part you can fix yourself. If it isn't there, reply on the ticket with your workspace ID and region and ask for the PostgreSQL CDC preview to be enabled. Until then, use whichever non-CDC ingestion mode the wizard allows if you need to start moving data.

References

[1] Manage your workspace - Azure Databricks | Microsoft Learn โ€” https://learn.microsoft.com/en-us/azure/databricks/admin/workspace-settings/

Anuj Lathi
Solutions Engineer @ Databricks