Re: BUG #15489: Segfault on DELETE

From: Frederico Galvão <frederico(dot)costa(dot)galvao(at)gmail(dot)com>
To: Langote_Amit_f8(at)lab(dot)ntt(dot)co(dot)jp
Cc: michael(at)paquier(dot)xyz, kanwei(at)gmail(dot)com, pgsql-bugs(at)lists(dot)postgresql(dot)org, noreply(at)postgresql(dot)org
Subject: Re: BUG #15489: Segfault on DELETE
Date: 2018-11-08 04:40:25
Message-ID: CAL02vUAtQ81AhQttcj5mXSR0HvbimCAMi4dWPja9fvNAUK7xyg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

I'm happy I could help, and I'm even happier to see you guys were 10 steps
ahead of me and already fixed it for 11.1, which I'm definitely looking
forward to.

On Wed, Nov 7, 2018 at 11:33 PM Amit Langote <Langote_Amit_f8(at)lab(dot)ntt(dot)co(dot)jp>
wrote:

> Thanks Frederico for your reply.
>
> On 2018/11/08 10:10, Frederico Costa Galvão wrote:
> > I stumbled upon this issue yesterday, and trying to reduce and pinpoint
> > it, I managed to get to this:
> >
> > //start
> > CREATE TABLE a (
> > id bigint
> > );
> >
> > INSERT INTO a (id) VALUES (1); -- this id's value doesn't matter
> >
> > ALTER TABLE ONLY a
> > ADD CONSTRAINT a_pkey PRIMARY KEY (id);
> >
> > CREATE TABLE b (
> > a_id bigint
> > );
> >
> > ALTER TABLE ONLY b
> > ADD CONSTRAINT b_a_id_fkey FOREIGN KEY (a_id) REFERENCES a(id);
> >
> > ALTER TABLE a ADD x BOOLEAN NOT NULL DEFAULT FALSE; -- or TRUE, doesn't
> > matter
>
> There it is. These are similar steps as I'd used to track down a bug
> that's now fixed in 11.1.
>
>
> https://www.postgresql.org/message-id/9cb4aa1c-12ba-59c3-fd75-545fa90fb92f%40lab.ntt.co.jp
>
> The bug had to do with foreign key trigger not getting a proper
> representation of the tuple being deleted, considering the newly added
> column.
>
> > -- VACUUM FULL ANALYZE a; -- uncomment this to fix the bug
>
> Ah, VACUUM FULL will rewrite the tuples such that they're not hit by the
> aforementioned bug.
>
> So, if OP can tell that this is what happened in their case too, then 11.1
> will have fixed the issue.
>
> Thanks,
> Amit
>
>

--
Frederico Costa Galvão
Engenheiro de Computação - Universidade Federal de Goiás
PontoGet Inovação Web
Tippz Mobile

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Tillmann Schulz 2018-11-08 09:20:13 Re: BUG #15448: server process (PID 22656) was terminated by exception 0xC0000005
Previous Message PG Bug reporting form 2018-11-08 04:30:05 BUG #15492: pg_cancel_backend(pg_backend_pid()) returns true sporadically