Re: [HACKERS] Issues with generate_series using integer boundaries

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: David Johnston <polobo(at)yahoo(dot)com>
Cc: Thom Brown <thom(at)linux(dot)com>, Andrew Dunstan <andrew(at)dunslane(dot)net>, Itagaki Takahiro <itagaki(dot)takahiro(at)gmail(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, PGSQL Mailing List <pgsql-general(at)postgresql(dot)org>
Subject: Re: [HACKERS] Issues with generate_series using integer boundaries
Date: 2011-06-17 14:45:12
Message-ID: BANLkTinzEL5ymMdWkzy-gRREUpQUK4kYVQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers

On Fri, Jun 17, 2011 at 10:39 AM, David Johnston <polobo(at)yahoo(dot)com> wrote:
> Tangential comment but have you considered emitting a warning (and/or log
> entry) when you are 10,000-50,000 away from issuing the last available
> number in the sequence so that some recognition exists that any code
> depending on the sequence is going to fail soon?
>
> Also, during sequence creation you know the integer type being used so that
> maximum value is known and an overflow should not need to come into play (I
> guess the trade-off is the implicit "try-catch" [or whatever mechanism C
> uses] performance hit versus the need to store another full integer in the
> data structure).
>
> You could also give access to the "warning threshold" value so that the
> developer can change it to whatever value is desired (with a meaningful
> default of course).

There are already tools out there that can monitor this stuff - for
example, check_postgres.pl.

http://bucardo.org/check_postgres/check_postgres.pl.html#sequence

We tend to avoid emitting warnings for this kind of thing because they
can consume vast amounts of disk space, and a lot of times no one's
looking at them anyway.

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Scott Ribe 2011-06-17 17:02:31 2 questions re RAID
Previous Message David Johnston 2011-06-17 14:39:04 Re: [HACKERS] Issues with generate_series using integer boundaries

Browse pgsql-hackers by date

  From Date Subject
Next Message Andrew Dunstan 2011-06-17 14:47:19 Re: Boolean operators without commutators vs. ALL/ANY
Previous Message David Johnston 2011-06-17 14:39:04 Re: [HACKERS] Issues with generate_series using integer boundaries