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.
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.