The column list kept last_seen_at out of the stream. The 3,060 updates that changed only it still arrived.

A publication column list kept last_seen_at out of 31,937,655 change records, yet the 3,060 updates that changed only it arrived with email and full_name.

Published
Updated
Reading time
15 min read
A users row of seven columns, user_id to last_seen_at, with only last_seen_at changed; the change record in raw holds the six published columns, email and full_name among them, and last_seen_at is not published; 3,060 of 3,060 updates that changed only last_seen_at arrived with email and full_name, and 0 of 31,937,655 records in raw carried last_seen_at A users row of seven columns, user_id to last_seen_at, with only last_seen_at changed; the change record in raw holds the six published columns, email and full_name among them, and last_seen_at is not published; 3,060 of 3,060 updates that changed only last_seen_at arrived with email and full_name, and 0 of 31,937,655 records in raw carried last_seen_at
The list decided which columns a record may carry. It did not decide whether the record is sent.
On this page

The product’s users table has a column, last_seen_at, that changes on every request. I left it out of the Postgres publication with a column list, so the platform’s raw layer would never hold it. It never did: 0 of 31,937,655 change records carried it. Then I counted the updates that had changed nothing else. All 3,060 of them still arrived in raw, each carrying email and full_name.

A column list is a control on columns. It is not a control on events, and the raw layer and the erasure job have to be designed for the difference. The same lab measured what schema changes do to the same stream, and there the result is better: a renamed column stopped one table, not the pipeline.

Operating rule. Read a publication’s column list as an allow-list of columns, not a filter on changes. Assume raw holds a copy of every published column on every update to the table, whichever column changed, and erase by key in raw. Let a contract check on the stream’s own schema announcement stop the one table whose schema broke.

The test

The lab copy of a SaaS company’s product database: PostgreSQL 17.11 in a container, 60,000 users, 6,000 accounts, 4 plans and 31.5 million events, written to at the brief’s peak of 12 events a second. The platform’s side of the stream is the lab’s own capture process, a stand-in for a managed CDC service. It reads the pgoutput stream, writes every change with its log position to an append-only raw layer, and staging builds from raw. It is not Debezium and not a vendor’s connector.

The publication, as the lab creates it:

create publication platform for table
    accounts,
    users (user_id, account_id, email, full_name, role, created_at),
    plans,
    events;

Column lists need PostgreSQL 15 or later. last_seen_at changes on every request and is the busiest column in the table: a full-row publication would have copied each user’s email and full_name into raw on every such change, and raw is kept for 25 months. The list was there to stop that. Three things were run against it:

  1. Updates that changed only users.last_seen_at. Every record in raw, from the initial snapshot and the stream, was searched for the column name, and the updates that changed nothing else were counted.
  2. A nullable column added, to users, which has a list, and to accounts, which is published whole, while capture and the workload ran.
  3. users.email renamed to email_address, the rename from the data contract’s own breaking fixture, also while capture ran.

What an update, a new column and a rename leave in raw

Product tablePostgreSQL 17.11
Publicationplatform
Change recordpgoutput
rawevery delivery kept
Stagingnamed columns

Column list: updates that changed only users.last_seen_at

users is published as user_id, account_id, email, full_name, role and created_at

  1. The publication lists users' columns without last_seen_at: user_id, account_id, email, full_name, role, created_at.
  2. A request updates users.last_seen_at and nothing else. 3,060 transactions in the run changed only that column.
  3. An update sends every published column, whichever one changed. The record carries email and full_name, not last_seen_at.
  4. Capture writes each one to raw. 3,060 of 3,060 arrived, carrying email and full_name. 0 of 31,937,655 records in raw carried last_seen_at. In raw: 3,060 of 3,060 with email and full_name.
  5. Staging opens a version only when a published column changes, so the copies stop at raw. In staging: no version opened.

Column added: a nullable column on users, then on accounts

users is published with a column list; accounts is published whole

  1. Capture and the workload are running. users is published with a column list, accounts whole.
  2. A nullable column, nickname, is added to users, and 20 users are updated to set it. The list does not name it, so no record carries it. In raw: 0 of 20 carry the column. Contract check: no new check ran.
  3. The same on accounts, which is published whole: a nullable column, tier, is added and 50 accounts are updated to set it.
  4. The new column reaches raw: 50 of 50 records carry it. The contract check accepts it as non-breaking (the check took 0.69 s), and staging keeps running. In raw: 50 of 50 carry the column. Contract check: non-breaking, the check took 0.69 s.
  5. Staging reads named columns, so it goes no further. raw holds the column unclassified until the contract names it. In staging: tier not read.

Rename: users.email renamed to email_address

the rename from the contract's own breaking fixture

  1. Capture and the workload are running. users.email is renamed to email_address, the rename from the contract's own breaking fixture.
  2. The first users change after the rename arrives. The stream announces the new column list before it, and capture runs the contract check on that.
  3. The check marks the change breaking; it decided 0.60 s after the first change: "Removed schema.users.properties.email". Contract check: breaking, decided 0.60 s after the first change.
  4. users stops in quarantine. raw keeps all 231 changes, and 0 of them loaded under the old mapping. In raw: 231 of 231 under email_address. In staging: 0 of 231 loaded under the old mapping.
  5. The other tables kept loading: accounts and plans stayed equal to the source by content, events by count. In staging: users held; accounts, plans, events loading.
PostgreSQL 17.11, pgoutput, the lab's own capture process, the lab copy of a SaaS company's database; one published run per scenario, at 12 events a second.

What arrived

Scenario What changed What arrived in raw Count Time
Column list users.last_seen_at alone, in 3,060 transactions an update record for each, carrying email and full_name 3,060 of 3,060 not timed
Column list every record in raw, snapshot and streamed records carrying last_seen_at 0 of 31,937,655 not timed
Column added nullable nickname on users (a column list), 20 users updated changes carrying nickname 0 of 20 no new check ran
Column added nullable tier on accounts (published whole), 50 accounts updated records carrying tier; the contract check: non-breaking 50 of 50 0.69 s
Rename users.email renamed to email_address 231 users changes, all under the new name; none loaded under the old mapping 0 of 231 loaded 0.60 s after the first change

Tier: how long the check took. Rename: time from the first change to the decision.

The 31,937,655 are every record in raw, for all four tables, searched for the column name. A zero over that many records says the list holds. It says nothing about the updates, and the 3,060 is the count that tests the design. It is also the lab’s count for its own workload, one run, not a rate for any product.

For the two schema changes, the counts are changes written after the change, set against the changes that carried it into raw. The scale is shared, so the bars compare.

Schema change Changes written after it Carrying the new column or name in raw
nullable nickname on users, which has a column list 20 0
nullable tier on accounts, published whole 50 50
users.email renamed to email_address 231 231

Only the list filtered anything. Raw took all 231 changes under the new name: the contract check works on what staging reads, not on what capture writes.

What the column list keeps out, and what it does not

An update sends every published column, whichever one changed (an unchanged TOASTed value is sent as a marker). The list decides which columns a record may carry. It does not decide whether a transaction that touched only an unpublished column produces a record, and on 17.11 it did, 3,060 times out of 3,060. Staging opens a version only when a published column changes, so those copies stop at raw. What the list saves is the column itself, and nothing downstream of raw.

So raw holds a copy of each user’s email and full_name for every update to users, not for every change to either. For the design, that is the number to erase against. These are the controls that exist, and what the lab measured each one doing:

To stop The control Measured
A column reaching raw the publication’s column list 0 of 31,937,655 records carried last_seen_at
An update that touched no published column reaching raw none in the lab’s publication; moving the column to its own table in the product 3,060 of 3,060 arrived
A new column on a table published whole reaching raw none: the check accepts an added column as non-breaking 50 of 50 records carried it
A breaking change loading under the old mapping the contract check, one table at a time 0 of 231 loaded

There were three ways to stop the copies of email and full_name, and the design picked the smallest:

  • Delete by key in raw. The copies stay and the erasure job reaches every one of them. The cost is the size of the rewrite: the job copies raw into a new file, because DuckDB kept every byte of deleted rows through DELETE, CHECKPOINT and VACUUM, and the lab’s 4.1 GB took 10 s. In the erasure drill, no row holding three erased users’ e-mail or name, or keyed to them, was left in raw or staging.
  • Drop the rows from raw once staging has read them. That stops the copies, but raw would no longer hold every delivery, which is what it is for.
  • Move last_seen_at to its own table in the product. That stops the copies at the source, and the column list can then go. It is the product team’s change to make, so it is on the decision’s list of reasons to revisit.

What a delete does and does not do on the file side is in We deleted the user from the Delta table. Time travel still returned all 100 rows, and what it costs by where the model keeps the identity is in erasing one person rewrote 31.8 million rows.

The same list is also a default for the table that has one. A column added to users stays out until the publication names it, so a new personal column there cannot reach the platform before the contract has classified it. That holds for users only. accounts, plans and events are published whole, so a column added to one of them reaches raw at once, and the stream-side check accepts it as non-breaking. Staging reads named columns, so it goes no further, but raw holds the column unclassified until the contract names it. On those tables nothing reads the column, and nothing has classified it either.

What a schema change does to the stream

The check runs on the schema the stream announces before the first change under it. Capture’s hook on that announcement builds an observed contract from the new column list and runs datacontract breaking (datacontract-cli 1.2.6) against the committed product contract. It writes a verdict to a decision table. Staging reads the table, and stops applying a quarantined table from that change’s log position.

The rename was marked breaking, with Removed schema.users.properties.email: Removed property email, 0.60 s after the first change under the new name. users stopped in quarantine. Raw kept all 231 changes, none of them loaded under the old mapping, and accounts and plans stayed equal to the source by content and events by count while users waited. That is the useful property of the check at this layer: drift becomes one held table and a decision, not a stopped pipeline and not a column of nulls.

The additive change shows where the check stops. tier on accounts was accepted in 0.69 s, which is the right verdict for the check, and the column still landed in raw unclassified. A compatibility check answers whether consumers of the old schema break. It does not answer whether the new column is personal. How such checks err is measured in removing an optional field breaks consumers, and adding one breaks history, on a different format and checker: 51 hand-labelled JSON Schema changes, no breaking change passed as safe, and 2 safe changes per direction flagged as breaking.

The producer’s CI is the first line and this check is the second. If a breaking change ships anyway, the stream-side check holds the table. Releasing a quarantined table is left to the migration agreed with the producer, and the lab did not build that step. It renamed the column back to compare staging with the source, and the full design is in the case study.

Checks on your own stream

  • Read what each table publishes. select tablename, attnames from pg_publication_tables where pubname = 'platform' order by 1; lists the columns. If a personal column should be out, the list is the only place that says so.
  • Search raw for the excluded column’s name. That is how the 0 of 31,937,655 was counted. A zero is the list working. Then ask which excluded columns change most often, because each update to one re-sends the published columns.
  • Decide how erasure reaches raw before the first copy lands. By key, in every layer, with a proof query after the retention window.
  • Name the tables published whole. Each is a table whose new columns reach raw unclassified.

pg-cdc-doctor checks one thing about a column list: CDC042 fails a table whose column list does not cover its replica identity, on PostgreSQL 15 to 19. Its other publication checks include a publication that does not exist, an action it does not publish, a row filter that uses a column outside the replica identity, and a listed table that is not in it. It does not read which columns you left out, so what the list keeps out and does not is a design decision it cannot check for you. What a recreated A replication slot records the WAL position that a standby or logical consumer has confirmed, and PostgreSQL retains all WAL after that position. An abandoned or stalled slot therefore grows pg_wal until the disk fills, unless max_slot_wal_keep_size limits it. loses is in We recreated the replication slot. Debezium said RUNNING, and five rows never arrived.

Boundary. One lab copy of one product database, on PostgreSQL 17.11 only, one published run per scenario. The platform’s side is the lab’s capture process, not Debezium and not a managed service. The 3,060 and the times are that run’s, from the lab’s workload at 12 events a second. A rename of a column the list does not name, a column list on PostgreSQL 15 or 16, and releasing a quarantined table were not run. The method and the results are in the CDC slice of data-platform-architecture.

Frequently asked questions

Does a PostgreSQL publication column list stop an update from being published?

No. In a test on PostgreSQL 17.11, the publication for users left out last_seen_at, and 0 of 31,937,655 change records in raw carried that column. But 3,060 updates that changed only last_seen_at were still published, and all 3,060 arrived in raw carrying email and full_name, because an update sends every published column whichever one changed.

What happens to a CDC stream when a column is added to a table that has a column list?

The new column stays out until the publication names it. In the lab, a nullable column added to users reached 0 of 20 changes. The same change on accounts, which is published whole, reached raw in 50 of 50 records, and the contract check accepted it as non-breaking in 0.69 s. So the list works as an allow-list for the table that has one.

What happens to a CDC pipeline when a source column is renamed?

With a contract check on the stream’s own schema announcement, it stops one table. After users.email was renamed, the check marked the change breaking 0.60 s after the first change under the new name. users went into quarantine, 0 of 231 changes loaded under the old mapping, and accounts, plans and events kept loading.

How should erasure treat a raw layer fed by a column-list publication?

Delete by key in raw and assume a copy of every published column per update, not per change to that column. The list saves the column itself and nothing downstream of raw. Staging opens a version only when a published column changes, so the extra copies stop at raw, and the erasure job reaches them by key.

The lab and its results are in data-platform-architecture. More on PostgreSQL and data quality.

Terms in this piece
replication slot
A replication slot records the WAL position that a standby or logical consumer has confirmed, and PostgreSQL retains all WAL after that position. An abandoned or stalled slot therefore grows pg_wal until the disk fills, unless max_slot_wal_keep_size limits it.

Basant Bhattarai is a data and AI architect with 9+ years in industry. He leads a team of five engineers and the architecture of data and AI platforms end to end: the data model, the databases underneath, governance and SOC 2 controls, and the AI built into them. He writes up what he measures, with the method beside each figure.

Currently: Senior Data Engineer at UXCam.

Building something similar? I'm open to long-term consulting, contract or full-time roles. Work with me