Re: lastval(seq) ?

Поиск
Список
Период
Сортировка
От Alvaro Herrera Munoz
Тема Re: lastval(seq) ?
Дата
Msg-id 20031021201236.GA29235@dcc.uchile.cl
обсуждение исходный текст
Ответ на Re: lastval(seq) ?  (CSN <cool_screen_name90001@yahoo.com>)
Список pgsql-general
On Tue, Oct 21, 2003 at 12:49:39PM -0700, CSN wrote:

> For updating sequences after copy importing data (with
> id's).
>
> Is there a transaction-safe way?

Sure:

begin;
lock table table;
select setval('table_id_seq', (select max(id) from table));
commit;

--
Alvaro Herrera (<alvherre[@]dcc.uchile.cl>)
"El sabio habla porque tiene algo que decir;
el tonto, porque tiene que decir algo" (Platon).

В списке pgsql-general по дате отправления:

Предыдущее
От: Jean-Michel POURE
Дата:
Сообщение: Re: DBDesigner for Linux
Следующее
От: "scott.marlowe"
Дата:
Сообщение: Re: lastval(seq) ?