Re: BUG #15114: logical decoding Segmentation fault - Mailing list pgsql-bugs

From Alvaro Herrera
Subject Re: BUG #15114: logical decoding Segmentation fault
Date
Msg-id 20180326160801.ja4j43hwrc35iuhb@alvherre.pgsql
Whole thread Raw
In response to Re: BUG #15114: logical decoding Segmentation fault  (Andres Freund <andres@anarazel.de>)
Responses Re: BUG #15114: logical decoding Segmentation fault  (Andres Freund <andres@anarazel.de>)
Re: BUG #15114: logical decoding Segmentation fault  (Alvaro Herrera <alvherre@alvh.no-ip.org>)
List pgsql-bugs
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


pgsql-bugs by date:

Previous
From: Andres Freund
Date:
Subject: Re: BUG #15114: logical decoding Segmentation fault
Next
From: Andres Freund
Date:
Subject: Re: BUG #15114: logical decoding Segmentation fault