Wonder if there is a way to add more details (like the column name, database) to logical replication errors in case of missing columns. I got general log entries like this:
2021年09月16日 14:47:37.149 CDT [32910] ERROR: logical replication target relation "public.users" is missing some replicated columns
I could not find anything related in the documentation. I am trying to detect these kinds of errors to trigger an alert or something like that. The only idea that I have is to watch the logs for entries like the above one. Any idea will be welcome!
1 Answer 1
That is obvious: the target table is missing some columns (or they have the wrong name).
The target table must have all the columns from the source table, although the definition of these columns need not to be identical.
This behavior has been improved in PostgreSQL v15.
-
Yeah, I know that. The problem is that the error messages do not show the column name so I was wondering if there is a way to show more information in the log like the missing columnJavier Galarza– Javier Galarza2021年09月20日 00:38:42 +00:00Commented Sep 20, 2021 at 0:38
-
No, you cannot get more log information - but if that is possible, it would be a nice improvement. Perhaps you could come up with a patch.Laurenz Albe– Laurenz Albe2021年09月20日 02:38:10 +00:00Commented Sep 20, 2021 at 2:38
-
1Bummer - thanks for your answer @LaurenzAlbe. Looks like there is already a discussion about that improvement: hereJavier Galarza– Javier Galarza2021年09月20日 15:11:03 +00:00Commented Sep 20, 2021 at 15:11