We need to capture changes done in the PostgreSQL DB tables, and are planning on using CDC for the same. We have a requirement to ignore/filter events which were written inn the DB by a specific user/application.
Is there a way to send the db user information in the event sent to Kafka, or the only way would be to start capturing this information as a table field? Is there any other way to filter out these change events?
Note: I see some older posts asking same questions and wanted to check if there is any new information regarding this. SQL Server Change Data Capture - Capture user who made the change
No, this is not possible. Logical decoding reverse engineers the information from the transaction log (WAL) and the catalog tables, and the WAL has no information about the acting user.
The only way I can see to have your requirement fulfilled is to store the modifying user in a table column that you explicitly create. Ideally, you would populate that column using a row level trigger.