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 20180416175901.mdevawuuhvwo3yk6@alvherre.pgsql
Whole thread Raw
In response to Re: BUG #15114: logical decoding Segmentation fault  (Alvaro Herrera <alvherre@alvh.no-ip.org>)
Responses Re: BUG #15114: logical decoding Segmentation fault
List pgsql-bugs
Alvaro Herrera wrote:

> 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.

Here's a patch.  There is a disadvantage: one additional syscache lookup
each time logicalrep_write_attrs() is called.  I think that's all right,
since that's done once for each relation being replicated (not, say,
once per tuple or once per transaction).  Even so, I tried to move this
code as a special "quick-path" case in RelationGetIndexAttrBitmap, so
that it could be cached separately without processing the other indexes.
That turned out a bit too messy for my taste.


-- 
Álvaro Herrera                https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

Attachment

pgsql-bugs by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: BUG #15144: *** glibc detected *** postgres: postgres smsconsole[local] SELECT: double free or corruption (!pre
Next
From: Emre Hasegeli
Date:
Subject: Re: Wrong Results from SP-GiST with Collations