Skip to main content

postgres_cdf_configs

Creates, updates, deletes, gets or lists a postgres_cdf_configs resource.

Overview

Namepostgres_cdf_configs
TypeResource
Iddatabricks_workspace.postgres.postgres_cdf_configs

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
namestringOutput only. The full resource name of the CdfConfig. Format: projects/{project}/branches/{branch}/databases/{database}/cdf-configs/{cdf_config}
cdf_config_idstringThe user-specified id; equals the final segment of ``name``. Defaults to the Postgres schema name for configs without an explicit id.
catalogstringThe Unity Catalog catalog that replicated tables are written into. Set at creation; the CdfConfig is immutable.
create_timestring (date-time)When the CdfConfig was created.
postgres_schemastringThe Postgres schema this CdfConfig replicates from. Unique within the parent database. Set at creation; the CdfConfig is immutable.
schemastringThe Unity Catalog schema that replicated tables are written into. Set at creation; the CdfConfig is immutable.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
listselectparent, deployment_namepage_size, page_tokenList all CDF configurations for a Lakebase database. Each configuration maps a Postgres schema to a
createinsertparent, deployment_name, cdf_configcdf_config_idCreate a CDF configuration that materializes the change data feed for all tables in a Postgres schema

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
deployment_namestringThe Databricks Workspace Deployment Name (default: dbc-abcd0123-a1bc)
parentstringThe parent database under which to create the CdfConfig. Format: projects/{project}/branches/{branch}/databases/{database}
cdf_config_idstringThe user-specified id for the CdfConfig, forming the final segment of its resource name. Must match the pattern [a-z][a-z0-9_]{0,62}. Defaults to the Postgres schema name when omitted.
page_sizeintegerMaximum number of CdfConfigs to return.
page_tokenstringPagination token returned by a previous ListCdfConfigs call. Empty on the first page.

SELECT examples

List all CDF configurations for a Lakebase database. Each configuration maps a Postgres schema to a

SELECT
name,
cdf_config_id,
catalog,
create_time,
postgres_schema,
schema
FROM databricks_workspace.postgres.postgres_cdf_configs
WHERE parent = '{{ parent }}' -- required
AND deployment_name = '{{ deployment_name }}' -- required
AND page_size = '{{ page_size }}'
AND page_token = '{{ page_token }}'
;

INSERT examples

Create a CDF configuration that materializes the change data feed for all tables in a Postgres schema

INSERT INTO databricks_workspace.postgres.postgres_cdf_configs (
cdf_config,
parent,
deployment_name,
cdf_config_id
)
SELECT
'{{ cdf_config }}' /* required */,
'{{ parent }}',
'{{ deployment_name }}',
'{{ cdf_config_id }}'
;