Skip site navigation (1) Skip section navigation (2)

Re: [HACKERS] Patch to warn about oid/xid wraparound

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Peter Eisentraut <peter_e(at)gmx(dot)net>
Cc: Lamar Owen <lamar(dot)owen(at)wgcr(dot)org>, PostgreSQL-patches <pgsql-patches(at)postgresql(dot)org>
Subject: Re: [HACKERS] Patch to warn about oid/xid wraparound
Date: 2001-06-13 21:04:32
Message-ID: 200106132104.f5DL4Xt27579@candle.pha.pa.us (view raw or flat)
Thread:
Lists: pgsql-hackerspgsql-patches
> Bruce Momjian writes:
> 
> > Here is an new patch that updates the percentage display when it is run,
> > rather than just displaying 75%.  I had to do the computation using
> > floats to prevent overflow.


Sorry, I should have been doing this on patches list.

> You could use ldiv().

It is overflow that I am worried about:  curr/max * 100
I don't see how ldiv helps here.

> 
> Also, UINT_MAX (for transaction id) and OID_MAX (for Oid) might be
> preferred over ~0.

Done.  Patch attached.

> 
> Btw., there is a typo here:
> 
> >     GetCurrentTransactionId() - (float)(~(TransactionId)0) * 100);

Thanks.  Fixed.  I hadn't gotten to testing the transaction code yet,
just the oid test.

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

In response to

pgsql-hackers by date

Next:From: Bruce MomjianDate: 2001-06-13 21:08:56
Subject: Re: [PATCH] addition of text_inet, text_cidr and inet_set_masklen
Previous:From: Peter EisentrautDate: 2001-06-13 20:55:45
Subject: RE: vacuum

pgsql-patches by date

Next:From: Bruce MomjianDate: 2001-06-13 21:06:59
Subject: Re: sequence.c compile failure
Previous:From: Peter EisentrautDate: 2001-06-13 20:35:26
Subject: Re: Patch to warn about oid/xid wraparound

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group