Preventing variables from "rolling over"

Поиск
Список
Период
Сортировка
От Dr. Evil
Тема Preventing variables from "rolling over"
Дата
Msg-id 20010530025811.22828.qmail@sidereal.kz
обсуждение исходный текст
Ответы Re: Preventing variables from "rolling over"  ("Thalis A. Kalfigopoulos" <thalis@cs.pitt.edu>)
Список pgsql-general
I assume that if I keep on adding to an INT4, at some point it will
roll over and become negative, and then if I add some more, it could
become positive.  Is there a way to prevent this?  Ie, I would like
for it to end with an error instead of wrapping around.  Or is there a
way to check for this condition before I do the addition?  Is there a
way to put a constraint on a variable, such that it's always positive?

Thanks

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

Предыдущее
От: "Tim Barnard"
Дата:
Сообщение: Re: PQclear question...
Следующее
От: "Karen Ellrick"
Дата:
Сообщение: RE: Problems with new data location