diff options
Diffstat (limited to 'src/backend/replication')
| -rw-r--r-- | src/backend/replication/pgoutput/pgoutput.c | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/src/backend/replication/pgoutput/pgoutput.c b/src/backend/replication/pgoutput/pgoutput.c index 19c10c028f9..1a80d67bb9c 100644 --- a/src/backend/replication/pgoutput/pgoutput.c +++ b/src/backend/replication/pgoutput/pgoutput.c @@ -1058,16 +1058,31 @@ pgoutput_column_list_init(PGOutputData *data, List *publications, /* Build the column list bitmap in the per-entry context. */ if (!pub_no_list) /* when not null */ { + int i; + int nliveatts = 0; + TupleDesc desc = RelationGetDescr(relation); + pgoutput_ensure_entry_cxt(data, entry); cols = pub_collist_to_bitmapset(cols, cfdatum, entry->entry_cxt); + /* Get the number of live attributes. */ + for (i = 0; i < desc->natts; i++) + { + Form_pg_attribute att = TupleDescAttr(desc, i); + + if (att->attisdropped || att->attgenerated) + continue; + + nliveatts++; + } + /* * If column list includes all the columns of the table, * set it to NULL. */ - if (bms_num_members(cols) == RelationGetNumberOfAttributes(relation)) + if (bms_num_members(cols) == nliveatts) { bms_free(cols); cols = NULL; |
