idx_rel = RelationIdGetRelation(replidindex);
+ if (!RelationIsValid(idx_rel))
+ elog(ERROR, "could not open relation with OID %u", replidindex);
+
/* deform tuple, so we have fast access to columns */
heap_deform_tuple(tp, desc, values, nulls);
relation = RelationIdGetRelation(reloid);
- if (relation == NULL)
+ if (!RelationIsValid(relation))
elog(ERROR, "could not open relation with OID %u (for filenode \"%s\")",
reloid,
relpathperm(change->data.tp.relnode,
relation = RelationIdGetRelation(relid);
- if (relation == NULL)
+ if (!RelationIsValid(relation))
elog(ERROR, "could not open relation with OID %u", relid);
if (!RelationIsLogicallyLogged(relation))
desc = RelationGetDescr(relation);
toast_rel = RelationIdGetRelation(relation->rd_rel->reltoastrelid);
+ if (!RelationIsValid(toast_rel))
+ elog(ERROR, "could not open relation with OID %u",
+ relation->rd_rel->reltoastrelid);
+
toast_desc = RelationGetDescr(toast_rel);
/* should we allocate from stack instead? */