Re: [GENERAL] How to increment by hand a sequence number.

Поиск
Список
Период
Сортировка
От Blashko Alexander
Тема Re: [GENERAL] How to increment by hand a sequence number.
Дата
Msg-id Pine.LNX.3.96.990118175403.520A-100000@lins.ospu.odessa.ua
обсуждение исходный текст
Ответ на How to increment by hand a sequence number.  (Valerio Santinelli <tanis@mediacom.it>)
Список pgsql-general

On Mon, 18 Jan 1999, Valerio Santinelli wrote:

> I've exported a table from an existing MSAccess database to my
> PostgreSQL db.
> I use a serial ID on the table and now I'm getting errors when I add a
> new entry in the table if i don't specify the ID by hand (which should
> be placed automatically by the db  since it's a serial).
>
> The exact error is this one:
>
>     Cannot insert a duplicate key into a unique index.
>
>
> I think I should set the "last_value" field in the sequence to my real
> last value aon the ID field of the table, but Idon't know how to do it.
> Is there anybody who can help me ?
you can get "last_value":
select max(ID) from table
you can create sequence with option 'start last_value+1' ( see man ).
>
> Thanks
>
> Valerio Santinelli
> tanis@mediacom.it
>
>
>


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

Предыдущее
От: Jeong Jae Ick:정재익:
Дата:
Сообщение: Re: [GENERAL] How to increment by hand a sequence number.
Следующее
От: "Jose' Soares"
Дата:
Сообщение: Re: [GENERAL] Representation of big integer numbers.