Обсуждение: unsigned int4

Поиск
Список
Период
Сортировка

unsigned int4

От
Scott M Jackson
Дата:
I looked in the FAQs, lists, docs, etc but couldn't find an answer to my
question.
Is there a way to specify an unsigned int, such that it would create an
ERROR condition if a transaction
were to attempt to cause a particular value to go negative. This would
be very useful to me.
I would like to be able to use the automatic rollback feature of WORK
blocks if a debit is generated that would
subtract more than it's positive balance. I feel this would be helpful
due to the concurrent nature of our bank
application.

Thanks for any help you can give me.

Scott Jackson (Scott.Jackson@pnl.gov)


Re: unsigned int4

От
Bruce Momjian
Дата:
> I looked in the FAQs, lists, docs, etc but couldn't find an answer to my
> question.
> Is there a way to specify an unsigned int, such that it would create an
> ERROR condition if a transaction
> were to attempt to cause a particular value to go negative. This would
> be very useful to me.
> I would like to be able to use the automatic rollback feature of WORK
> blocks if a debit is generated that would
> subtract more than it's positive balance. I feel this would be helpful
> due to the concurrent nature of our bank
> application.

Oid should be unsigned int.  Not sure it is completely implemented, but
it should be.


--
  Bruce Momjian                        |  http://www.op.net/~candle
  pgman@candle.pha.pa.us               |  (610) 853-3000
  +  If your life is a hard drive,     |  830 Blythe Avenue
  +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026

Re: unsigned int4

От
Peter Eisentraut
Дата:
On Mon, 3 Apr 2000, Scott M Jackson wrote:

> Is there a way to specify an unsigned int, such that it would create
> an ERROR condition if a transaction were to attempt to cause a
> particular value to go negative.

CREATE TABLE... (
  ...
  colname INTEGER CHECK (colname > 0)
  ...
);

--
Peter Eisentraut                  Sernanders väg 10:115
peter_e@gmx.net                   75262 Uppsala
http://yi.org/peter-e/            Sweden