Preventing variables from "rolling over"

From: "Dr(dot) Evil" <drevil(at)sidereal(dot)kz>
To: pgsql-general(at)postgreSQL(dot)org
Subject: Preventing variables from "rolling over"
Date: 2001-05-30 02:58:11
Message-ID: 20010530025811.22828.qmail@sidereal.kz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Karen Ellrick 2001-05-30 04:48:55 RE: Problems with new data location
Previous Message Tim Barnard 2001-05-29 22:35:33 Re: PQclear question...