Re: STARTING SERIAL / BIGSERIAL FIELDS FROM 1.

Поиск
Список
Период
Сортировка
От Lacey Powers
Тема Re: STARTING SERIAL / BIGSERIAL FIELDS FROM 1.
Дата
Msg-id 4A6545FE.3060104@commandprompt.com
обсуждение исходный текст
Ответ на STARTING SERIAL / BIGSERIAL FIELDS FROM 1.  (JORGE MALDONADO <jorgemal1960@gmail.com>)
Ответы Re: STARTING SERIAL / BIGSERIAL FIELDS FROM 1.  (Michael Wood <esiotrot@gmail.com>)
Список pgsql-novice
Hello Jorge,

An even easier way to accomplish this would be to use the following:

ALTER SEQUENCE <sequence_name> RESTART WITH 1;

As shown in the documentation, here:

http://www.postgresql.org/docs/8.3/interactive/sql-altersequence.html

Hope that helps. =)

Sincerely,

Lacey
> How can a serial or bigserial field start from 1 again?
> I need to manually remove all the records from a table and I need
> these kind of fields to start from 1 once again.
>
> With respect,
> Jorge Maldonado


--
Lacey Powers

The PostgreSQL Company - Command Prompt, Inc. 1.503.667.4564 ext 104
PostgreSQL Replication, Consulting, Custom Development, 24x7 support


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

Предыдущее
От: "tgs"
Дата:
Сообщение: Re: trouble connecting to DB
Следующее
От: Lacey Powers
Дата:
Сообщение: Re: trouble connecting to DB