BUG #8408: Not exactly correct error messages for failed check in presence of dropped columns.

Поиск
Список
Период
Сортировка
От maxim.boguk@gmail.com
Тема BUG #8408: Not exactly correct error messages for failed check in presence of dropped columns.
Дата
Msg-id E1VFH1h-0002tY-Nt@wrigleys.postgresql.org
обсуждение исходный текст
Ответы Re: BUG #8408: Not exactly correct error messages for failed check in presence of dropped columns.  (Michael Paquier <michael.paquier@gmail.com>)
Список pgsql-bugs
The following bug has been logged on the website:

Bug reference:      8408
Logged by:          Maxim Boguk
Email address:      maxim.boguk@gmail.com
PostgreSQL version: 9.2.4
Operating system:   Any
Description:

There are simple test case:


create table test_columns (id serial primary key, value int
check(value<10));
NOTICE:  CREATE TABLE will create implicit sequence "test_columns_id_seq"
for serial column "test_columns.id"
NOTICE:  CREATE TABLE / PRIMARY KEY will create implicit index
"test_columns_pkey" for table "test_columns"
CREATE TABLE




insert into test_columns(value) values (100);
ERROR:  new row for relation "test_columns" violates check constraint
"test_columns_value_check"
DETAIL:  Failing row contains (1, 100).


--it's ok...
--now let drop value column and add new one


alter table test_columns drop column value;
ALTER TABLE


alter table test_columns add column "value" int check (value < 10);
ALTER TABLE


insert into test_columns(value) values (100);
ERROR:  new row for relation "test_columns" violates check constraint
"test_columns_value_check"
DETAIL:  Failing row contains (2, null, 100).


-- now (2, null, 100) sound weird...


And yes I completely understand where this NULL came from and why this
happened.


However, I think error message should filter dropped column and strange null
values (because if a table has a lot dropped column this error message
quickly become completely unreadable).


Regards,
Maksym

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

Предыдущее
От: Andres Freund
Дата:
Сообщение: Re: BUG #8407: json_populate_record case sensitivity
Следующее
От: Kevin Grittner
Дата:
Сообщение: Re: BUG #8400: DB size changed after restore