You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/content/docs/connectors/pipeline-connectors/postgres.md
+74-2Lines changed: 74 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -245,10 +245,10 @@ pipeline:
245
245
<tr>
246
246
<td>metadata.list</td>
247
247
<td>optional</td>
248
-
<td style="word-wrap: break-word;">false</td>
248
+
<td style="word-wrap: break-word;">(none)</td>
249
249
<td>String</td>
250
250
<td>
251
-
List of readable metadata from SourceRecord to be passed to downstream and could be used in transform module, split by `,`. Available readable metadata are: op_ts.
251
+
List of readable metadata from SourceRecord to be passed to downstream and could be used in transform module, split by `,`. Available readable metadata are: op_ts, table_name, database_name, schema_name. See <a href="#supported-metadata-columns">Supported Metadata Columns</a> for more details.
252
252
</td>
253
253
</tr>
254
254
<tr>
@@ -311,6 +311,78 @@ Metrics can help understand the progress of assignments, and the following are t
311
311
Notice:
312
312
1. The group name is `namespace.schema.table`, where `namespace` is the actual database name, `schema` is the actual schema name, and `table` is the actual table name.
313
313
314
+
## Supported Metadata Columns
315
+
316
+
PostgreSQL CDC connector supports reading metadata columns from source records. These metadata columns can be used in transform operations or passed to downstream sinks.
317
+
318
+
**Note:** Some metadata information is also available through Transform expressions (e.g., `__namespace_name__`, `__schema_name__`, `__table_name__`). The key differences are:
319
+
- **`op_ts`**: Only available via `metadata.list` - provides the actual operation timestamp from the database.
320
+
- **`table_name`, `database_name`, `schema_name`**: Can be obtained via either `metadata.list` or Transform expressions. Using `metadata.list` allows you to pass these values directly to downstream sinks without writing transform rules, which is simpler for basic use cases.
321
+
322
+
To enable metadata columns, configure the `metadata.list` option with a comma-separated list of metadata column names:
<td>The timestamp (in milliseconds since epoch) when the change event occurred in the database. For snapshot records, this value is 0.</td>
347
+
</tr>
348
+
<tr>
349
+
<td>table_name</td>
350
+
<td>STRING NOT NULL</td>
351
+
<td>The name of the table that contains the changed row. Alternative: use <code>__table_name__</code> in Transform expressions.</td>
352
+
</tr>
353
+
<tr>
354
+
<td>database_name</td>
355
+
<td>STRING NOT NULL</td>
356
+
<td>The name of the database that contains the changed row. Alternative: use <code>__namespace_name__</code> in Transform expressions.</td>
357
+
</tr>
358
+
<tr>
359
+
<td>schema_name</td>
360
+
<td>STRING NOT NULL</td>
361
+
<td>The name of the schema that contains the changed row. This is specific to PostgreSQL. Alternative: use <code>__schema_name__</code> in Transform expressions.</td>
Copy file name to clipboardExpand all lines: flink-cdc-connect/flink-cdc-pipeline-connectors/flink-cdc-pipeline-connector-postgres/src/main/java/org/apache/flink/cdc/connectors/postgres/source/PostgresDataSource.java
0 commit comments