BUG #2704: pg_class.relchecks overflow problem

Поиск
Список
Период
Сортировка
От Toru SHIMOGAKI
Тема BUG #2704: pg_class.relchecks overflow problem
Дата
Msg-id 200610180035.k9I0ZdEl075100@wwwmaster.postgresql.org
обсуждение исходный текст
Ответы Re: BUG #2704: pg_class.relchecks overflow problem  (Toru SHIMOGAKI <shimogaki.toru@oss.ntt.co.jp>)
Список pgsql-bugs
The following bug has been logged online:

Bug reference:      2704
Logged by:          Toru SHIMOGAKI
Email address:      shimogaki.toru@oss.ntt.co.jp
PostgreSQL version: 8.1.4
Operating system:   Red Hat Enterprise Linux AS 4
Description:        pg_class.relchecks overflow problem
Details:

Hi,

pg_class.relchecks is defined as int2. But the upper bound of this value is
not checked and it overflows.


I found it at the following case:

1. I tried to add check constraints:

"alter table test_a add check (aaa > i);" (0 <= i <= 32767)


2. When I added the 32768th check constraint, the value of pg_class.relchecs
became -32768.

postgres=# alter table test_a add check ( aaa > 32768 );
ALTER TABLE
postgres=# select relname, relchecks from pg_class where relname =
'test_a';
relname | relchecks
---------+-----------
test_a | -32768
(1 row)


3. The following error message was found when I added the next one:

postgres=# alter table test_a add check ( aaa > 32769 );
ERROR: unexpected constraint record found for rel test_a
postgres=# select relname, relchecks from pg_class where relname =
'test_a';
relname | relchecks
---------+-----------
test_a | -32768
(1 row)


Best regards,

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

Предыдущее
От:
Дата:
Сообщение: Re: 8.2beta1 (w32): server process crash (tsvector)
Следующее
От: Joe Conway
Дата:
Сообщение: Re: BUG #2694: Memory allocation error when selecting array