Re: [PATCHES] BUG #2704: pg_class.relchecks overflow problem

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: [PATCHES] BUG #2704: pg_class.relchecks overflow problem
Дата
Msg-id 20878.1163305730@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: BUG #2704: pg_class.relchecks overflow problem  (Toru SHIMOGAKI <shimogaki.toru@oss.ntt.co.jp>)
Ответы Re: [HACKERS] [PATCHES] BUG #2704: pg_class.relchecks overflow  (Toru SHIMOGAKI <shimogaki.toru@oss.ntt.co.jp>)
Список pgsql-bugs
Toru SHIMOGAKI <shimogaki.toru@oss.ntt.co.jp> writes:
> +         if (numchecks == 0x7FFF)
> +             ereport(ERROR,
> +                     (errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED),
> +               errmsg("cannot have more than 2^15-1 checks in a table")));

While there's not anything wrong with this proposed patch in itself,
I have to admit that I don't see the point.  There are probably
thousands of places in the backend where we increment an integer
value without checking for overflow.  Is this one particularly more
likely to occur than other ones, or does it have worse consequences
than other ones?  I don't see a security issue here (since the backend
doesn't crash) and I also don't see that this limit is close enough to
real practice to be important to guard against.

It's not that the check imposes any significant addition in code space
or runtime, but what it *would* impose is a nontrivial extra burden on
our message translators.  Scale this up by a few hundred or thousand
equally unlikely conditions with their own error messages, and we'd
have a revolt ...

            regards, tom lane

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

Предыдущее
От: "Simon Riggs"
Дата:
Сообщение: Re: [PERFORM] BUG #2737: hash indexing large table fails,while btree of same index works
Следующее
От: "Thomas H."
Дата:
Сообщение: Re: 8.2beta1 (w32): server process crash (tsvector)