Re: get last sequence

From: Alfonso Peniche <alfonso(at)iteso(dot)mx>
To:
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: get last sequence
Date: 2001-01-27 01:50:22
Message-ID: 3A72295E.71E903D7@iteso.mx
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message The Hermit Hacker 2001-01-27 02:07:00 Re: postgres limitation
Previous Message Rudolf Potucek 2001-01-27 01:46:23 MS Excel to PostgreSQL?