Re: BUG #15247: At 'ALTER TABLE ADD COLUMN fast default' , Setattmissingval to NULL in the pg_attribute, query fail

Поиск
Список
Период
Сортировка
От Michael Paquier
Тема Re: BUG #15247: At 'ALTER TABLE ADD COLUMN fast default' , Setattmissingval to NULL in the pg_attribute, query fail
Дата
Msg-id 20180619055017.GC6421@paquier.xyz
обсуждение исходный текст
Ответ на BUG #15247: At 'ALTER TABLE ADD COLUMN fast default' ,Set attmissingval to NULL in the pg_attribute, query fail  (PG Bug reporting form <noreply@postgresql.org>)
Список pgsql-bugs
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

Вложения

В списке pgsql-bugs по дате отправления:

Предыдущее
От: PG Bug reporting form
Дата:
Сообщение: BUG #15247: At 'ALTER TABLE ADD COLUMN fast default' ,Set attmissingval to NULL in the pg_attribute, query fail
Следующее
От: Andrew Gierth
Дата:
Сообщение: Re: BUG #15247: At 'ALTER TABLE ADD COLUMN fast default' , Set attmissingval to NULL in the pg_attribute, query fail