kamiseq <kamiseq@xxxxxxxxx> writes: > select into _id lastval(); > and is that safe operation, can I rely on lastval() that it will > return value of id that was inserted before? You want to use currval() with the sequence name. > can it happened that other user will insert something between my > insert and select? currval() specifically written to be safe in this case. -Doug ---------------------------(end of broadcast)--------------------------- TIP 4: Have you searched our list archives? http://archives.postgresql.org/