# Backfilling Postgres TOAST Columns in Debezium Data Change Events

DevFeed: [Backfilling Postgres TOAST Columns in Debezium Data Change Events](<https://devfeed.tech/articles/backfilling-postgres-toast-columns-in-debezium-data-change-events-18798.md>)

Original publisher: [Read original article](<https://www.morling.dev/blog/backfilling-postgres-toast-columns-debezium-change-events/>)

Published: 2025-05-26T14:40:00Z

Content type: article

Language: en

Sources: [Gunnar Morling](<https://devfeed.tech/sources/gunnar-morling.md>)

Topics: [Databases](<https://devfeed.tech/topics/databases.md>), [Replication](<https://devfeed.tech/topics/replication.md>), [apache-flink](<https://devfeed.tech/topics/apache-flink.md>), [stream-processing](<https://devfeed.tech/topics/stream-processing.md>), [SQL](<https://devfeed.tech/topics/sql.md>), [API](<https://devfeed.tech/topics/api.md>)

Tags: [apache-flink](<https://devfeed.tech/tags/apache-flink.md>), [data](<https://devfeed.tech/tags/data.md>), [debezium](<https://devfeed.tech/tags/debezium.md>), [debezium-connector](<https://devfeed.tech/tags/debezium-connector.md>), [flink](<https://devfeed.tech/tags/flink.md>), [postgres](<https://devfeed.tech/tags/postgres.md>), [replication](<https://devfeed.tech/tags/replication.md>), [sql](<https://devfeed.tech/tags/sql.md>), [stateful](<https://devfeed.tech/tags/stateful.md>), [stream-processing](<https://devfeed.tech/tags/stream-processing.md>)

## AI overview

This article explains how Postgres logical replication handles TOAST columns in Debezium change events. It discusses Debezium's reselect postprocessor and explores Apache Flink solutions using stateful stream processing, Flink SQL, and process table functions.

## Source excerpt

Table of Contents Debezium Reselect Postprocessor Flink DataStream API Flink SQL With OVER Aggregation Flink Process Table Functions Summary and Discussion Postgres logical replication, while powerful for capturing real-time data changes, presents challenges with TOAST columns, whose values can be absent from data change events in specific situations. This post discusses how Debezium addresses this through its built-in reselect post processor, then explores more robust solutions leveraging Apache Flink's capabilities for stateful stream processing, including Flink SQL and the brand-new process table functions (PTFs) in Flink 2.1.