Results 1 to 2 of 2
  1. #1
    Join Date
    Apr 2011
    Posts
    8

    Unanswered: Serial and BigSerial maxvalues

    When I define a serial or bigserial field type, a sequence is created. In any case, the maxvalue equals 9223372036854775807 which corresponds to a bigint value. Why?

    Respectfully,
    Jorge Maldonado

  2. #2
    Join Date
    Nov 2003
    Posts
    2,935
    Provided Answers: 12
    Probably because sequences are based on bigint, so there is no way to create a sequence that returns integers.

    Quote Originally Posted by Postgres manual
    Sequences are based on bigint arithmetic, so the range cannot exceed the range of an eight-byte integer
    Taken from: http://www.postgresql.org/docs/curre...esequence.html

    If you are concerned about this, then use a bigserial type.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •