Re: nextval/dbi question

From: harrold(at)sage(dot)che(dot)pitt(dot)edu
To: Horst Herb <hherb(at)malleenet(dot)net(dot)au>
Cc: Pgsql Novice <pgsql-novice(at)postgresql(dot)org>
Subject: Re: nextval/dbi question
Date: 2001-08-05 23:06:54
Message-ID: Pine.LNX.4.21.0108051905050.18298-100000@sage.che.pitt.edu
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

john
There is no operating system but linux and linus is its kernel maintainer.

Sometime in August Horst Herb assaulted keyboard and produced...

|On Monday 06 August 2001 08:47, harrold(at)sage(dot)che(dot)pitt(dot)edu wrote:
|
|> i was under the impression that nextval would give what the nextval would
|> be. i didnt think it was suppose to increment it. after reading your
|> response and someone else's it seems i need to get the next value of the
|> key and insert it explicitly is that correct?
|
|Yes. Alternatively, you can let Postgres use nextval implicitly, and call
|currval afterwards to get the value of the inserted "nextval"
|

thanks.
one more question. what can i do to prevent another insert from taking
place before the currval request is made? is this even an issue aslong as
the currval query is executed using the same connection?

john

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message Tom Lane 2001-08-05 23:09:31 Re: nextval/dbi question
Previous Message Horst Herb 2001-08-05 23:02:55 Re: nextval/dbi question