Don't try to print data type names in slot_store_error_callback().
authorTom Lane <tgl@sss.pgh.pa.us>
Fri, 2 Jul 2021 20:04:54 +0000 (16:04 -0400)
committerTom Lane <tgl@sss.pgh.pa.us>
Fri, 2 Jul 2021 20:04:54 +0000 (16:04 -0400)
commit50371df266d4c8f4faaf448cbd789d9697443952
treec87c5cd9c948232c981ee98b9bebab48b4d74921
parent6bd3ec62d9d7921fad2125bbeb5f2eafbbb261e5
Don't try to print data type names in slot_store_error_callback().

The existing code tried to do syscache lookups in an already-failed
transaction, which is problematic to say the least.  After some
consideration of alternatives, the best fix seems to be to just drop
type names from the error message altogether.  The table and column
names seem like sufficient localization.  If the user is unsure what
types are involved, she can check the local and remote table
definitions.

Having done that, we can also discard the LogicalRepTypMap hash
table, which had no other use.  Arguably, LOGICAL_REP_MSG_TYPE
replication messages are now obsolete as well; but we should
probably keep them in case some other use emerges.  (The complexity
of removing something from the replication protocol would likely
outweigh any savings anyhow.)

Masahiko Sawada and Bharath Rupireddy, per complaint from Andres
Freund.  Back-patch to v10 where this code originated.

Discussion: https://postgr.es/m/20210106020229.ne5xnuu6wlondjpe@alap3.anarazel.de
src/backend/replication/logical/relation.c
src/backend/replication/logical/worker.c
src/include/replication/logicalrelation.h