Re: STARTING SERIAL / BIGSERIAL FIELDS FROM 1.

Поиск
Список
Период
Сортировка
От Jure Kobal
Тема Re: STARTING SERIAL / BIGSERIAL FIELDS FROM 1.
Дата
Msg-id 200907202143.06215.j.kobal@gmx.com
обсуждение исходный текст
Ответ на STARTING SERIAL / BIGSERIAL FIELDS FROM 1.  (JORGE MALDONADO <jorgemal1960@gmail.com>)
Список pgsql-novice
For every serial/bigserial you have a table that should be named something like
<table_name>_<column_name>_seq where table_name is the name of the table in
which the serial is used and column_name is the name of the column that is the
serial. It can be that it will be only <table_name>_seq. But depends on how you
set up the table.
The table should look something like this:

 sequence_name | last_value | increment_by | ...
-------------------+------------+---------------+ ...
    album_seq     |        461   |            1      | ...

for what you want you will need to change the last_value column.


Regard
Jure

On Monday 20 of July 2009 20:54:33 JORGE MALDONADO wrote:
> 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

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

Предыдущее
От: Michael Wood
Дата:
Сообщение: Re: how to ignore a column from pg_dump
Следующее
От: Michael Wood
Дата:
Сообщение: Re: STARTING SERIAL / BIGSERIAL FIELDS FROM 1.