pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Frederico Costa Galvão <frederico.costa.galvao@gmail.com>
To: Michael Paquier <michael@paquier.xyz>
To: Amit Langote <Langote_Amit_f8@lab.ntt.co.jp>
Cc: kanwei@gmail.com, pgsql-bugs@lists.postgresql.org, PG Bug reporting form <noreply@postgresql.org>
Subject: Re: Re: BUG #15489: Segfault on DELETE
Date: Wed, 7 Nov 2018 23:10:18 -0200
Message-ID: <a4873070-d39f-874d-8dfc-55ba4b6aaa09@gmail.com> (raw)
In-Reply-To: <20181107071409.GA17169@paquier.xyz>
References: <15489-f1158ddcc2584a8e@postgresql.org>
	<26334113-2b97-db62-b72c-8066c2dedbb5@lab.ntt.co.jp>
	<20181107071409.GA17169@paquier.xyz>

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

-- VACUUM FULL ANALYZE a; -- uncomment this to fix the bug

DELETE FROM a;
//end

This was the bare minimum I could get to reproduce the segfault on a 
portable way. It's something between foreign keys pointing to tables 
that have gone through the new no-table-rewrite handling of nonnull 
columns with non-volatile default values.

Also, VACUUM ANALYZE itself didn't fix the corrupted data: it needs to 
be FULL.

I'm on <Xubuntu 16.04 x86_64>, with <psql (PostgreSQL) 11.0 (Ubuntu 
11.0-1.pgdg16.04+2)>.
I have some simple custom settings on postgresql.conf that I don't think 
are related to the issue, but I'm willing to provide if needed.

---

Frederico Costa Galvão

On 07/11/2018 05:14, Michael Paquier wrote:
> On Wed, Nov 07, 2018 at 02:34:12PM +0900, Amit Langote wrote:
>> Are there any triggers defined on integration_account?  Also, has there
>> recently been any ALTER TABLE DROP/DROP COLUMN activity on that table?
>>
>> PG 11.1 to be released later this week fixed a bug that would cause
>> segmentation fault when running triggers (including, but not limited to
>> DELETE triggers).
> The point is that without more information about the schema used which
> would allow to build a reproducible test case from the ground, or even
> better a self-contained test case, then there is nothing much we can do
> except assuming about what kind of things have been happening here.
> --
> Michael




view thread (8+ messages)  latest in thread

Message-ID: <a4873070-d39f-874d-8dfc-55ba4b6aaa09@gmail.com>
Permalink:  ../a4873070-d39f-874d-8dfc-55ba4b6aaa09@gmail.com/
Also on:    postgresql.org/message-id/a4873070-d39f-874d-8dfc-55ba4b6aaa09@gmail.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: frederico.costa.galvao@gmail.com, michael@paquier.xyz, Langote_Amit_f8@lab.ntt.co.jp, noreply@postgresql.org
  Subject: Re: BUG #15489: Segfault on DELETE
  In-Reply-To: <a4873070-d39f-874d-8dfc-55ba4b6aaa09@gmail.com>
  References: <15489-f1158ddcc2584a8e@postgresql.org> <26334113-2b97-db62-b72c-8066c2dedbb5@lab.ntt.co.jp> <20181107071409.GA17169@paquier.xyz> <a4873070-d39f-874d-8dfc-55ba4b6aaa09@gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox