Received: from malur.postgresql.org ([2a02:16a8:dc51::56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fV9X9-000873-Qh for pgsql-bugs@arkaria.postgresql.org; Tue, 19 Jun 2018 05:50:27 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1fV9X7-0003qE-Ug for pgsql-bugs@arkaria.postgresql.org; Tue, 19 Jun 2018 05:50:25 +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 1fV9X7-0003px-OT for pgsql-bugs@lists.postgresql.org; Tue, 19 Jun 2018 05:50:25 +0000 Received: from out2-smtp.messagingengine.com ([66.111.4.26]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fV9X4-0000eO-OQ for pgsql-bugs@lists.postgresql.org; Tue, 19 Jun 2018 05:50:25 +0000 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 53DC62228C; Tue, 19 Jun 2018 01:50:21 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Tue, 19 Jun 2018 01:50:21 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paquier.xyz; h= content-type:date:from:in-reply-to:message-id:mime-version :references:subject:to:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; bh=Z6p0Qs+J9qVZ20FslSLVhfCmOK47BqPiwuv7qHMEOhs=; b=339dE7P2 kB4HHKauWSN09Md8tbGzrHxDUsjnDzq+kgFsyNA9UtPd+sBEDSW1NKv78VYnXB0A 9kaiCXhGQefYntINJAdq75J8ITOXTdh6IqZNVXZD1McrIBYYMHoXyIraAWnK20vM ZOwnRdbRWZx7wT4bVviZ9hhVlHbonwhEXyIYBYYMLEb67bg6BQcaEw27busruP5C Iefzp3wv0Mb4GrwFODHt73uy4L2Ro0ic+lw+d9cm70toL7NMZ6btxeSBIRtS1/iF smpg27fINI9mVaPTxbXZVpmdynmx14CWg/SnupzVwDbVh1kYHdGwZKMmmYiim4XR E8a3lohzDBEYSQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-sender :x-me-sender:x-sasl-enc; s=fm3; bh=Z6p0Qs+J9qVZ20FslSLVhfCmOK47B qPiwuv7qHMEOhs=; b=r4e3J6djBTAN/mjT7a7ehVXd5+AIje0GFmBYtYFo/GNhM 7aLz6hvp0X1qWdI744LlNQC+TIgRwkcatzcCYCF82VPWI7Pdqofr+EI9wu4oLdRK 4ANJkoIiGhxI//ZEFbvg0CPiFcpDwvTJYBnjZNZ/mEA1tpAk1xQTS6kGLTDvNvL7 ZwBFslvug1m3Mi8o6agHF0PjncdZdirHfJoVtMJZNwKqYBovSJLSmOs5r0TcfJ8s 7Abq3+DiARGOxvXSFG7IPZW/72+RfGFOI5cREvcFZmkFigEXeEJNaoJ+Tt1g/fT/ /2ngmoeyQfvvDVEJKIwv4y/SFp8xg/pmkgOQk9RGA== X-ME-Proxy: X-ME-Sender: Received: from paquier.xyz (c137162.net61215.cablenet.ne.jp [61.215.137.162]) by mail.messagingengine.com (Postfix) with ESMTPA id 3B507E4426; Tue, 19 Jun 2018 01:50:19 -0400 (EDT) Date: Tue, 19 Jun 2018 14:50:17 +0900 From: Michael Paquier To: liguangxian1995@gmail.com, pgsql-bugs@lists.postgresql.org Subject: Re: BUG #15247: At 'ALTER TABLE ADD COLUMN fast default' , Set attmissingval to NULL in the pg_attribute, query fail Message-ID: <20180619055017.GC6421@paquier.xyz> References: <152938199549.1445.15943776243848338882@wrigleys.postgresql.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="wULyF7TL5taEdwHz" Content-Disposition: inline In-Reply-To: <152938199549.1445.15943776243848338882@wrigleys.postgresql.org> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --wULyF7TL5taEdwHz Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Jun 19, 2018 at 04:19:55AM +0000, PG Bug reporting form wrote: > (1) create table test(a int); > (2) insert into test values(1),(2),(3); > (3) alter table test add b int not null default 0; > (4) update pg_attribute set attmissingval =3D NULL where attname =3D 'b'; > (5) select b from test; > Then,query the b field from the test table(select b from test;) , lead to > server closed the connection unexpectedly . >=20 > I think this a bug ,or not. Meanwhile,I think we should add an statement > --if(att->atthasmissing && tupleDesc->constr->missing) .Not Assert(). Well, you are directly manipulating a catalog with a DML query, which is not a supported operation, so you are shooting yourself in the foot here. There are many more and various ways to trigger failures. -- Michael --wULyF7TL5taEdwHz Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAlsomZkACgkQnvQgOdby QH26zhAAnVFuAkMPG/LrbOPTaHA7DaMI3b9363aAk2hsj5/wOgXO2YFvjLkEe85c KwEY98GSI0aol0u0B8ZUaDNiFDgGdiFCadEgry81beWStrmmPIMlzsT51XboGCh9 tnmkUcFzsUOyE6MHMTJh2gPdS4VB6INTit8dtipFwUOcqHqMAZKQeb+opjll9L39 roJdSt/1nsTTg2NUuPfn04UPIQWtuqCXviX62gSCWmq8JxRRZ1JJRfeLEJfQlkx+ Baool96cZw07+nupWrwIjNh2sh24x6lWCwzCCvR/jwwQ4bRgHODaS1zOhtTeLwGN cpxGa9g3J/++4sKAlMzdnTs5hdNmo8++VwNqFxoyKww1UCJGlV5V8644aEYgmbto B90imqfzOsdqxqi52Lt23jInBIN8pFD54rzTD6d9aqySkk7i0PlTvh3MSC8nX6x0 bbj/Fz7MJNe1hTH8ixkNdD/byFT5RRt0FgQ1jITFCLQwViNVah8GjQ98UmZcJcYN uvB8QWJN1n3hiInE0cbCAznf3RcqPnATQYj1FBHw0oyjwCIT9VNlK+uwagv5zrDt xAnjEE0IjAm7wVM6cwaVSRQW5Kz6LA7sm6Kqj7jLutj3PJWqO4BIZGsIyLQCYKsm yU59o24Uhd0pWvkRCZlUBgYIC9AJgUMcxqrdi370vxZVotuXq0I= =RtE8 -----END PGP SIGNATURE----- --wULyF7TL5taEdwHz--