Returns the value most recently obtained by nextval for this sequence in the current session.
Signatures & examples
currval ( regclass ) → bigint
Returns 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.) 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.Version history 1