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 1fVKqX-000231-9j for pgsql-bugs@arkaria.postgresql.org; Tue, 19 Jun 2018 17:55:13 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1fVHXt-0002JV-Ue for pgsql-bugs@arkaria.postgresql.org; Tue, 19 Jun 2018 14:23:45 +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 1fVHXt-0002JM-Ob for pgsql-bugs@lists.postgresql.org; Tue, 19 Jun 2018 14:23:45 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fVHXp-000407-HV for pgsql-bugs@lists.postgresql.org; Tue, 19 Jun 2018 14:23:43 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id w5JENbJU010838; Tue, 19 Jun 2018 10:23:37 -0400 From: Tom Lane To: Andrew Gierth cc: pgsql-bugs@lists.postgresql.org, liguangxian1995@gmail.com Subject: Re: BUG #15247: At 'ALTER TABLE ADD COLUMN fast default' , Set attmissingval to NULL in the pg_attribute, query fail In-reply-to: <87d0wnqta9.fsf@news-spur.riddles.org.uk> References: <152938199549.1445.15943776243848338882@wrigleys.postgresql.org> <87d0wnqta9.fsf@news-spur.riddles.org.uk> Comments: In-reply-to Andrew Gierth message dated "Tue, 19 Jun 2018 07:05:43 +0100" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <10836.1529418216.1@sss.pgh.pa.us> Date: Tue, 19 Jun 2018 10:23:36 -0400 Message-ID: <10837.1529418216@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Andrew Gierth writes: > "PG" == PG Bug reporting form writes: > PG> (4) update pg_attribute set attmissingval = NULL where attname = 'b'; > Nobody ever claimed that you could update pg_attribute without crashing > the server; I can think of half a dozen ways to do it. Specifically, you broke it by not keeping atthasmissing consistent with attmissingval. Manually corrupting catalogs like that is not a supported operation. regards, tom lane