pg.ddx.io pgsql-bugs@postgresql.org mailing list archive
help / color / mirror / Atom feedSequence id NOT incremented as expected
3+ messages / 2 participants
[nested] [flat]
* Sequence id NOT incremented as expected
@ 2012-07-20 08:19 SINGHAL Harsh <harsh.singhal@cy-play.com>
2012-07-20 14:08 ` Re: Sequence id NOT incremented as expected Tom Lane <tgl@sss.pgh.pa.us>
0 siblings, 1 reply; 3+ messages in thread
From: SINGHAL Harsh @ 2012-07-20 08:19 UTC (permalink / raw)
To: pgsql-bugs
FACTS :
1. Sequences are based on bigint arithmetic, so the range cannot exceed
the range of an eight-byte integer (-9223372036854775808 to
9223372036854775807). On some older platforms, there may be no
compiler support for eight-byte integers, in which case sequences
use regular integer arithmetic (range -2147483648 to +2147483647).
2. The CYCLE option allows the sequence to wrap around when the
maxvalue or minvalue has been reached by an ascending or descending
sequence respectively. If the limit is reached, the next number
generated will be the minvalue or maxvalue, respectively.
Reality :
* version
PostgreSQL 8.4.12 on x86_64-pc-linux-gnu, compiled by GCC
gcc-4.4.real (Debian 4.4.5-8) 4.4.5, 64-bit
* Colonne|Type|Valeur
sequence_name|name|xxx_id_seq
last_value|bigint|1
start_value|bigint|1
increment_by|bigint|1
max_value|bigint|9223372036854775807
min_value|bigint|1
cache_value|bigint|1
log_cnt|bigint|32
is_cycled|boolean|t
is_called|boolean|t
* In an increasing sequence whose max value is set to
9223372036854775807 and cycle option is activated, as shown above,
from 2147483647 to 9223372036854775807 it is displaying error
"ERREUR: entier en dehors des limites" and after that it resets it
to 1 which is normal for any sequence whose cycle option is activated.
* Can you please tell what to do during the interval (2147483647 to
9223372036854775807) or How to restart the sequence at 2147483647 ?
--
--
Harsh Raj SINGHAL
Cy-Play
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: Sequence id NOT incremented as expected
2012-07-20 08:19 Sequence id NOT incremented as expected SINGHAL Harsh <harsh.singhal@cy-play.com>
@ 2012-07-20 14:08 ` Tom Lane <tgl@sss.pgh.pa.us>
2012-07-20 14:18 ` Re: Sequence id NOT incremented as expected SINGHAL Harsh <harsh.singhal@cy-play.com>
0 siblings, 1 reply; 3+ messages in thread
From: Tom Lane @ 2012-07-20 14:08 UTC (permalink / raw)
To: SINGHAL Harsh <harsh.singhal@cy-play.com>; +Cc: pgsql-bugs
SINGHAL Harsh <harsh.singhal@cy-play.com> writes:
> * In an increasing sequence whose max value is set to
> 9223372036854775807 and cycle option is activated, as shown above,
> from 2147483647 to 9223372036854775807 it is displaying error
> "ERREUR: entier en dehors des limites" and after that it resets it
> to 1 which is normal for any sequence whose cycle option is activated.
You didn't show us any context here, but this sounds like you're trying
to store the sequence's result into a integer (not bigint) column.
If so, that's not a bug, it's just pilot error.
regards, tom lane
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: Sequence id NOT incremented as expected
2012-07-20 08:19 Sequence id NOT incremented as expected SINGHAL Harsh <harsh.singhal@cy-play.com>
2012-07-20 14:08 ` Re: Sequence id NOT incremented as expected Tom Lane <tgl@sss.pgh.pa.us>
@ 2012-07-20 14:18 ` SINGHAL Harsh <harsh.singhal@cy-play.com>
0 siblings, 0 replies; 3+ messages in thread
From: SINGHAL Harsh @ 2012-07-20 14:18 UTC (permalink / raw)
To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: pgsql-bugs
Thanks a lot, Tom.
--
Harsh Raj SINGHAL
Cy-Play
On 20/07/12 16:08, Tom Lane wrote:
> SINGHAL Harsh <harsh.singhal@cy-play.com> writes:
>> * In an increasing sequence whose max value is set to
>> 9223372036854775807 and cycle option is activated, as shown above,
>> from 2147483647 to 9223372036854775807 it is displaying error
>> "ERREUR: entier en dehors des limites" and after that it resets it
>> to 1 which is normal for any sequence whose cycle option is activated.
> You didn't show us any context here, but this sounds like you're trying
> to store the sequence's result into a integer (not bigint) column.
> If so, that's not a bug, it's just pilot error.
>
> regards, tom lane
>
^ permalink raw reply [nested|flat] 3+ messages in thread
end of thread, other threads:[~2012-07-20 14:18 UTC | newest]
Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2012-07-20 08:19 Sequence id NOT incremented as expected SINGHAL Harsh <harsh.singhal@cy-play.com>
2012-07-20 14:08 ` Tom Lane <tgl@sss.pgh.pa.us>
2012-07-20 14:18 ` SINGHAL Harsh <harsh.singhal@cy-play.com>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox