Preventing variables from "rolling over" - Mailing list pgsql-general

From Dr. Evil
Subject Preventing variables from "rolling over"
Date
Msg-id 20010530025811.22828.qmail@sidereal.kz
Whole thread Raw
Responses Re: Preventing variables from "rolling over"  ("Thalis A. Kalfigopoulos" <thalis@cs.pitt.edu>)
List 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 by date:

Previous
From: "Tim Barnard"
Date:
Subject: Re: PQclear question...
Next
From: "Karen Ellrick"
Date:
Subject: RE: Problems with new data location