Fix RelationIdGetRelation calls that weren't bothering with error checks.
authorTom Lane
Sun, 8 Sep 2019 21:00:30 +0000 (17:00 -0400)
committerTom Lane
Sun, 8 Sep 2019 21:00:58 +0000 (17:00 -0400)
commit5f73d7294d9fbaa36a0167e7aa6fa693c9c724e6
treed91b3b25b2ae5892899b41e6cc8cc0bf5651bb19
parent1df4123048c49dda878bbe3b49616b0ff3b3dbe5
Fix RelationIdGetRelation calls that weren't bothering with error checks.

Some of these are quite old, but that doesn't make them not bugs.
We'd rather report a failure via elog than SIGSEGV.

While at it, uniformly spell the error check as !RelationIsValid(rel)
rather than a bare rel == NULL test.  The machine code is the same
but it seems better to be consistent.

Coverity complained about this today, not sure why, because the
mistake is in fact old.
src/backend/access/heap/heapam.c
src/backend/replication/logical/reorderbuffer.c