Getting the current value of a sequence - Mailing list pgsql-novice

From JORGE MALDONADO
Subject Getting the current value of a sequence
Date
Msg-id CAAY=A7-QbOXAOvRPQdpSndXe+aJ+d+h4+zsmP1q7L4P1JrF=rA@mail.gmail.com
Whole thread Raw
Responses Re: Getting the current value of a sequence  (hubert depesz lubaczewski <depesz@depesz.com>)
Re: Getting the current value of a sequence  (Roxanne Reid-Bennett <rox@tara-lu.com>)
Re: Getting the current value of a sequence  (amulsul <sul_amul@yahoo.co.in>)
List pgsql-novice
I have been trying to get the current value of a sequence without success. I have read that "currval" does the job but I do not know how to use it. This is what I have tried and I get an error saying that "currval of sequence 'name_of_sequence' is not defined for the session.

SELECT currval('name_of_sequence')

I will very much appreciate your feedback.

Respectfully,
Jorge Maldonado

pgsql-novice by date:

Previous
From: amul sul
Date:
Subject: Re: How to disable auto-commit in postgresql-9.4
Next
From: hubert depesz lubaczewski
Date:
Subject: Re: Getting the current value of a sequence