Results 1 to 3 of 3
  1. #1
    Join Date
    May 2004
    Posts
    1

    Question Unanswered: Postgresql sequence problem

    I create a sequence but the nextval its working bat, nextval show me a bigger value that the currval('') no the next one.
    For example: the currval('') show 50 and the nextval('') show 120 and then nextval('') show 121!!!


  2. #2
    Join Date
    Feb 2002
    Location
    San Francisco, CA
    Posts
    441
    Does it really matter though?

    (if your using it for a primary key field it doesn't)

  3. #3
    Join Date
    Jun 2004
    Posts
    3
    I think it may be something to do with the connection session you are in. I quote from the Postgresql manual:

    'currval
    Return the value most recently obtained by nextval for this sequence in the current session. (An error is reported if nextval has never been called for this sequence in this session.) Notice that because this is returning a session-local value, it gives a predictable answer even if other sessions are executing nextval meanwhile. '

Posting Permissions

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