FAQ
The following bug has been logged online:

Bug reference: 5809
Logged by: mahmoud elzaiady
Email address: melzaiady@yahoo.co.uk
PostgreSQL version: 8.4
Operating system: windows xp
Description: bigserial duplicate value
Details:

I have problem today
i have table and colum type bigserial
and insert data automatic number
but i found the value duplicate
i ask ,bigserial must not duplicate the value ?
how solve this problem

Search Discussions

  • Jeff Davis at Jan 3, 2011 at 7:11 pm

    On Sun, 2011-01-02 at 11:40 +0000, mahmoud elzaiady wrote:
    The following bug has been logged online:

    Bug reference: 5809
    Logged by: mahmoud elzaiady
    Email address: melzaiady@yahoo.co.uk
    PostgreSQL version: 8.4
    Operating system: windows xp
    Description: bigserial duplicate value
    Details:

    I have problem today
    i have table and colum type bigserial
    and insert data automatic number
    but i found the value duplicate
    i ask ,bigserial must not duplicate the value ?
    how solve this problem
    This is probably due to the sequence being reset somehow. Have you
    dumped/reloaded recently? Did you manually back up or copy the table?

    What is the exact error message that you see? If it tells you the
    duplicated value, is it very old, perhaps 1 (indicating a reset of the
    sequence)?

    Note that, by "reset", I do not mean "overflow". I mean that the
    sequence might have been recreated somehow.

    Try to provide more detail in your bug report. See:
    http://wiki.postgresql.org/wiki/Guide_to_reporting_problems

    Regards,
    Jeff Davis
  • Joshua Tolley at Jan 4, 2011 at 4:35 pm

    On Mon, Jan 03, 2011 at 11:04:17AM -0800, Jeff Davis wrote:
    On Sun, 2011-01-02 at 11:40 +0000, mahmoud elzaiady wrote:
    i ask ,bigserial must not duplicate the value ?
    how solve this problem
    This is probably due to the sequence being reset somehow. Have you
    dumped/reloaded recently? Did you manually back up or copy the table?
    Alternatively, perhaps at some point you've added data to that column, rather
    than relying on PostgreSQL to supply a default value.

    --
    Joshua Tolley / eggyknap
    End Point Corporation
    http://www.endpoint.com
  • Melzaiady at Jan 5, 2011 at 5:45 am
    i relying on PostgreSQL to supply a default value,
    i  have application at  hospital and application appear error about duplicate
    value.

    There was a primary key on this columns but i found error form my application
    about duplicate value and can`t insert value then i remove the primary key
    constraint to try  to find problem and try again i found bigserial  put
    duplicate value on fields .


    ________________________________

    Mahmoud El Zaiady
    Bachelor of Information Systems
    Faculty of Computers & Information Sciences
    Mansoura University







    ________________________________
    From: Joshua Tolley <eggyknap@gmail.com>
    To: Jeff Davis <pgsql@j-davis.com>
    Cc: mahmoud elzaiady <melzaiady@yahoo.co.uk>; pgsql-bugs@postgresql.org
    Sent: Tue, January 4, 2011 6:34:57 PM
    Subject: Re: [BUGS] BUG #5809: bigserial duplicate value
    On Mon, Jan 03, 2011 at 11:04:17AM -0800, Jeff Davis wrote:
    On Sun, 2011-01-02 at 11:40 +0000, mahmoud elzaiady wrote:
    i ask ,bigserial must not duplicate the value ?
    how solve this problem
    This is probably due to the sequence being reset somehow. Have you
    dumped/reloaded recently? Did you manually back up or copy the table?
    Alternatively, perhaps at some point you've added data to that column, rather
    than relying on PostgreSQL to supply a default value.

    --
    Joshua Tolley / eggyknap
    End Point Corporation
    http://www.endpoint.com
  • Robert Haas at Jan 6, 2011 at 10:48 pm

    On Wed, Jan 5, 2011 at 12:38 AM, Melzaiady wrote:
    i relying on PostgreSQL to supply a default value,
    i  have application at  hospital and application appear error about
    duplicate value.
    There was a primary key on this columns but i found error form my
    application about duplicate value and can`t insert value then i remove the
    primary key constraint to try  to find problem and try again i found
    bigserial  put duplicate value on fields .
    I'm pretty sure there isn't a bug that's making the sequence return
    duplicate values, because if there were, a lot more people would have
    complained about it by now. I think there's probably a bug in your
    application logic, but you haven't provided enough detail to figure
    out what it is. I'd suggest examining your log files for clues, and
    perhaps posting relevant sections of them here.

    It's not surprising that if you're getting duplicate key errors and
    you drop the index, you would then get actual duplicate keys...

    --
    Robert Haas
    EnterpriseDB: http://www.enterprisedb.com
    The Enterprise PostgreSQL Company
  • Melzaiady at Jan 8, 2011 at 11:25 am
    http://postgresql.1045698.n5.nabble.com/file/n3332998/data1.jpg

    this picture of screen you can new sequence of value.

    now how can i slove this problem and this field dont start new squences in
    any time ?
    --
    View this message in context: http://postgresql.1045698.n5.nabble.com/BUG-5809-bigserial-duplicate-value-tp3325115p3332998.html
    Sent from the PostgreSQL - bugs mailing list archive at Nabble.com.
  • Robert Haas at Jan 12, 2011 at 4:00 pm

    On Sat, Jan 8, 2011 at 6:10 AM, melzaiady wrote:
    http://postgresql.1045698.n5.nabble.com/file/n3332998/data1.jpg

    this picture of screen you can new sequence of value.

    now how can i slove this problem and this field dont start new squences in
    any time ?
    It's pretty hard to tell what's actually going on here, but your
    original complaint is that you're getting duplicate values, and there
    are no duplicate values shown in this picture. It's not even clear
    that the sequence is resetting itself -- it might just be that the
    values are sorted as strings rather than integers. But if it is
    getting reset, it's not happening magically behind the scenes - some
    human being or program is resetting it.

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

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppgsql-bugs @
categoriespostgresql
postedJan 2, '11 at 11:40a
activeJan 12, '11 at 4:00p
posts7
users4
websitepostgresql.org
irc#postgresql

People

Translate

site design / logo © 2021 Grokbase