if (!att->attisdropped && remoteattnum >= 0)
{
- StringInfo colvalue = &tupleData->colvalues[remoteattnum];
+ StringInfo colvalue;
+
+ if (remoteattnum >= tupleData->ncols)
+ ereport(ERROR,
+ (errcode(ERRCODE_PROTOCOL_VIOLATION),
+ errmsg("logical replication column %d not found in tuple: only %d column(s) received",
+ remoteattnum + 1, tupleData->ncols)));
- Assert(remoteattnum < tupleData->ncols);
+ colvalue = &tupleData->colvalues[remoteattnum];
/* Set attnum for error callback */
apply_error_callback_arg.remote_attnum = remoteattnum;
if (remoteattnum < 0)
continue;
- Assert(remoteattnum < tupleData->ncols);
+ if (remoteattnum >= tupleData->ncols)
+ ereport(ERROR,
+ (errcode(ERRCODE_PROTOCOL_VIOLATION),
+ errmsg("logical replication column %d not found in tuple: only %d column(s) received",
+ remoteattnum + 1, tupleData->ncols)));
if (tupleData->colstatus[remoteattnum] != LOGICALREP_COLUMN_UNCHANGED)
{
if (!att->attisdropped && remoteattnum >= 0)
{
- Assert(remoteattnum < newtup.ncols);
+ if (remoteattnum >= newtup.ncols)
+ ereport(ERROR,
+ (errcode(ERRCODE_PROTOCOL_VIOLATION),
+ errmsg("logical replication column %d not found in tuple: only %d column(s) received",
+ remoteattnum + 1, newtup.ncols)));
+
if (newtup.colstatus[remoteattnum] != LOGICALREP_COLUMN_UNCHANGED)
target_perminfo->updatedCols =
bms_add_member(target_perminfo->updatedCols,