Re: get last sequence

Alfonso Peniche <alfonso@iteso.mx>

From: Alfonso Peniche <alfonso@iteso.mx>
To:
Cc: pgsql-general@postgresql.org
Date: 2001-01-27T01:50:22Z
Lists: pgsql-general
"Mr. Chan" wrote:

> dear all,
>     how to get last sequence from postgresql? I mean such mysql
> last_insert_id function or ms sql select @@identity.
> thanks!
> Chan

Select currval('sequence_name_id') from tablename;

this will give you the last sequence generated in tablename