Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1gKYq7-0001bm-EX for pgsql-bugs@arkaria.postgresql.org; Thu, 08 Nov 2018 01:10:31 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gKYq5-0002Iu-2c for pgsql-bugs@arkaria.postgresql.org; Thu, 08 Nov 2018 01:10:29 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1gKYq4-0002Ik-Qd for pgsql-bugs@lists.postgresql.org; Thu, 08 Nov 2018 01:10:28 +0000 Received: from mail-qk1-x741.google.com ([2607:f8b0:4864:20::741]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gKYq1-000642-0V for pgsql-bugs@lists.postgresql.org; Thu, 08 Nov 2018 01:10:28 +0000 Received: by mail-qk1-x741.google.com with SMTP id 131so23923349qkd.4 for ; Wed, 07 Nov 2018 17:10:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding:content-language; bh=VAjsu2iHqRmkrMlfrWld5KnNbz33QWaT9p4Tg32daLE=; b=K3SNaOQyPfeYbgSe/qVA4HzG6OKTjpJH34/6i0WZ8HLjHQ8QJcgKiI6jpVOdi8uxzq psLKMG91Pa7kgqAW4OjWQn40O9WHzkPRq3zpF3SOBYKqmHwNaWHvQ/R1k8G6smBbKOf6 YgfZFMHthhoBS67Hag/frriJFlntGV5l3yqOFt2h+MfJ1vC/30w5AEx2dOAiyPw3y7Ob 5FkMXsswsPASqQOi0BJ3FcPtXcRtfA+c6jyYMPYcE2pufZ8JVrAFkMlx4+kyd6QsZASr M9pe8tCGoAzOy54fmQAcHHH2bUWnlyb8ExfV2bsk7cPDqEztnMRIjbMMsQ3DziM+rnx6 NsEQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=VAjsu2iHqRmkrMlfrWld5KnNbz33QWaT9p4Tg32daLE=; b=hb4BkookHOmQlcGMbUPZubKPtilYwnIPdRcpNl8CIoYvql8HdDxsP/XUBVDrPXKA5g 6/+lTcInCkfiHickJAOf6rRryQAcZcPbmyBM19ZdphTYCsYtIY2qXJRoNBt3WRQi78vq pka10bk/gr6nThmaoZBbe4ImLdvsLUxTh6u/vaRLa/l9v/aTb86kSOcqvOp9RlEXp8QR ojcASCzH22p2fLID6xUbbSzD75b8dOI/lqZqOQfTRMNKWN7jV8ymzGL3Gitk5575LiWf 3YFo9wfNIGbrdJJ8HIdEUfix3aT9d4sUg+l3Hvyix+DJwzxnWcuJY8ag6X9bHB62P2+r 9abQ== X-Gm-Message-State: AGRZ1gKK5HBWYuFNgj/88m60WbmdlLu6BA7pAioN2t0TIlDMZACm3VWW 0mykfP+cGEA5MYbDlsLY0hM= X-Google-Smtp-Source: AJdET5cWUTd/f1Rj+Fmt6S6XesN4CT2td7EImUMVhe6sfUf9um/s1hgzCVK6Z/dz+QPEZBc06DeeDA== X-Received: by 2002:ac8:4258:: with SMTP id r24mr2552381qtm.213.1541639422691; Wed, 07 Nov 2018 17:10:22 -0800 (PST) Received: from [172.22.1.90] ([200.146.225.49]) by smtp.gmail.com with ESMTPSA id t43sm1899945qtc.53.2018.11.07.17.10.20 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 07 Nov 2018 17:10:22 -0800 (PST) Subject: Re: Re: BUG #15489: Segfault on DELETE To: Michael Paquier , Amit Langote Cc: kanwei@gmail.com, pgsql-bugs@lists.postgresql.org, PG Bug reporting form References: <15489-f1158ddcc2584a8e@postgresql.org> <26334113-2b97-db62-b72c-8066c2dedbb5@lab.ntt.co.jp> <20181107071409.GA17169@paquier.xyz> From: =?UTF-8?Q?Frederico_Costa_Galv=c3=a3o?= Message-ID: Date: Wed, 7 Nov 2018 23:10:18 -0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.2.1 MIME-Version: 1.0 In-Reply-To: <20181107071409.GA17169@paquier.xyz> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk 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 , with . 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