Re: [Postgresql-it] Sequenze

  • From: Matteo Sgalaberni <sgala@xxxxxxxxx>
  • To: postgresql-it@xxxxxxxxxxxxxxxxx
  • Date: Mon, 7 Feb 2005 10:22:34 +0100

On Mon, Feb 07, 2005 at 09:56:51AM +0100, max jacob wrote:



SELECT currval() è mio amico per recuperare il valore generato.

non può dare problemi su accessi concorrenti?
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 whether or not other sessions have executed nextval since the
    current session did. 

è super isolato, super sicuro, super super.
 
go, go

M.


Other related posts: