Search Postgresql Archives

Re: problems with currval and rollback

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Without seeing the SQL statements you executed in the session it is difficult to see your problem.

Getting a current sequence after a rollback is no problem (in 8.0 anyway). Please note though, the sequence itself is NOT rolled back. This is correct behaviour. Currval will return the last sequence retrieved for the session (using nextval), even if other sessions have accessed the sequence in the intervening time.

Eddy


Assad Jarrahian wrote:

Hi all,
  So I started to make some changes with my code here and there
(nothing to do with the relevant lines) and suddenly currval and
rollback don't work.


<snip content="code"/>

What happens is that the it inserts a db, but cannot get a value back
using currval  (ERROR: ERROR: currval of sequence "lm_id_seq" is not
yet defined in this session 55000  ) , yet the db gets the addlm
inserted.


Shouldn't it rollback?
Furthermore, why would currval suddenly stop working?

Much thanks for your feedback in advance.

-assad



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux