Skip to content

[Improvement] PG cdc support trigger rows contain the complete batch DDL query #549

Description

@caiq1nyu

PostgreSQL batch DDL needs special handling here.

When multiple DDL statements are sent in one client request, the event trigger is invoked per DDL command, but current_query() returns the full query string. Therefore multiple rows in ddl_meta_tb may contain the same batch SQL instead of the individual DDL statement.

During replay, the sink executes the whole batch as one prepared statement, causing:

cannot insert multiple commands into a prepared statement

This is not a sink limitation. The issue is that the extractor assumes ddl_text represents a single statement.

The fix maybe should split batch DDL at the extractor layer and replay each statement independently while preserving the existing prepared statement execution model.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions