Hi,
pglogical_read_tuple from pglogical_proto.c contains the following code:
natts = pq_getmsgint(in, 2);if (rel->natts != natts) elog(ERROR, "tuple natts mismatch, %u vs %u", rel->natts,
natts);
But if table was just altered and some attribute was removed from the
table, then rel->natts can be greater than natts.
The problem can be fixed by the following patch:
--- a/pglogical_proto.c
+++ b/pglogical_proto.c
@@ -263,10 +263,15 @@ pglogical_read_tuple(StringInfo in, PGLogicalRelation *rel, { int
attid = rel->attmap[i]; Form_pg_attribute att = desc->attrs[attid];
- char kind = pq_getmsgbyte(in);
+ char kind; const char *data; int len;
+ if (att->atttypid == InvalidOid) {
+ continue;
+ }
+ kind = pq_getmsgbyte(in);
+ switch (kind) { case 'n': /* null */
--
Konstantin Knizhnik
Postgres Professional: http://www.postgrespro.com
The Russian Postgres Company