Re: Multi-insert into a partitioned table with before insert row trigger causes server crash on latest HEAD

From: Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)com>
To: Ashutosh Sharma <ashu(dot)coek88(at)gmail(dot)com>
Cc: Andres Freund <andres(at)anarazel(dot)de>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>, david(dot)rowley(at)2ndquadrant(dot)com
Subject: Re: Multi-insert into a partitioned table with before insert row trigger causes server crash on latest HEAD
Date: 2018-10-17 18:45:01
Message-ID: 568945fb-28a7-c06a-c65d-64eac471a3ee@2ndquadrant.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 16/10/2018 06:33, Ashutosh Sharma wrote:
> I think, the root cause of this problem is that CopyFrom() is using
> the stale value of *has_before_insert_row_trig* to determine if the
> current partition is okay for multi-insert or not i.e.
> has_before_insert_row_trig used to determine multi-insert condition
> for the current partition actually belongs to old partition. I think,
> *has_before_insert_row_trig* needs to updated before CopyFrom()
> evaluates if the current partition is good to go for multi insert or
> not. Attached is the patch based on this. I've also added the relevant
> test-case for it. Peter, David, Could you please have a look into the
> attached patch and share your thoughts. Thank you.

I have committed your fix and test, moving some code around a bit. Thanks.

--
Peter Eisentraut http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Adam Brusselback 2018-10-17 19:00:41 Re: Implementation of Flashback Query
Previous Message Andres Freund 2018-10-17 18:34:06 Re: Large writable variables