Re: How to debug logical replication error "columns are missing" if they are not - Mailing list pgsql-admin

From Thomas Kellerer
Subject Re: How to debug logical replication error "columns are missing" if they are not
Date
Msg-id ceb2b879-2f4f-2582-af02-c04d031a2fb7@gmx.net
Whole thread Raw
In response to How to debug logical replication error "columns are missing" if they are not  (Thomas Kellerer <shammat@gmx.net>)
List pgsql-admin
Samed YILDIRIM schrieb am 25.08.2020 um 08:09:
> Have you dropped any column during or after main schema changes?
>
> If yes, you should add columns you dropped on publisher side to
> subscriber side. These two tables can be identical now. But, if you
> added a column to publisher, and then dropped it, and you never added
> the column(s) on subscriber side, you would get error. Because, you
> are looking current status of tables, but logs that should be
> consumed and data that should be replicated belong to past.

The change involved dropping two columns and adding a new one.
But the dropped columns were already present on the subscriber

The change essentially merged two date columns into a single daterange column.

So what would have been the correct approach here then?

1. Adding the new column on the subscriber
2. Let replication catch up
3. then drop the old columns on the subscriber

Regards
Thomas




pgsql-admin by date:

Previous
From: Thomas Kellerer
Date:
Subject: Re: How to debug logical replication error "columns are missing" if they are not
Next
From: Thomas Kellerer
Date:
Subject: Re: How to debug logical replication error "columns are missing" if they are not