Andres Freund wrote:
> Alvaro, Petr: If I understand correctly what happens here is that some
> *other* column than the replica identity has a predicate with a full
> blown SQL function. We shouldn't evaluate arbitrary code like that
> inside the otuput plugin!
>
> So RelationGetIndexAttrBitmap() builds a bitmap of *all* indexed
> columns. Besides the code exec problem above, this is also just
> inefficient. I think this needs to be replaced by some replident
> bespoke code?
I agree -- I think logicalrep_write_attrs() should not use
RelationGetIndexAttrBitmap at all but instead use some lower-level way
to obtain columns of the replica identity. I don't know whether there
are historical-snapshot-related considerations to care about, in this
code, though.
This is neither my area nor my code, but if Petr and Peter decline
producing a patch for this quickly, I can look at it in a few days.
--
Álvaro Herrera https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services