From: Michael Paquier <michael@paquier.xyz>
To: liguangxian1995@gmail.com
To: 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
Date: Tue, 19 Jun 2018 14:50:17 +0900
Message-ID: <20180619055017.GC6421@paquier.xyz> (raw)
In-Reply-To: <152938199549.1445.15943776243848338882@wrigleys.postgresql.org>
References: <152938199549.1445.15943776243848338882@wrigleys.postgresql.org>
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 = NULL where attname = '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 .
>
> 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
Attachments:
signature.asc (application/pgp-signature, 832B) download
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: michael@paquier.xyz, 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: <20180619055017.GC6421@paquier.xyz>
References: <152938199549.1445.15943776243848338882@wrigleys.postgresql.org> <20180619055017.GC6421@paquier.xyz>
* 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