Re: Alter sequence restart with selected value...

Поиск
Список
Период
Сортировка
Искать
От
Scott Marlowe
Тема
Re: Alter sequence restart with selected value...
Дата
Msg-id
dcc563d10709180915yb50f79dlc39dca6f3db36040@mail.gmail.com
Ответ на
Список
Дерево обсуждения
Alter sequence restart with selected value... Jeff Ross <jross@wykids.org>
Re: Alter sequence restart with selected value... "Scott Marlowe" <scott.marlowe@gmail.com>
Re: Alter sequence restart with selected value... Jeff Ross <jross@wykids.org>
On 9/18/07, Jeff Ross  wrote:
> I'm using copy to insert a bunch of rows into a new table with a unique
> primary key.  Copy is correctly incrementing the primary key, but
> apparently the sequence itself is never updated because when I go to
> insert again I get a constraint violation.

Try using setval.

select setval('seqname',select max(id) from tablename));
В списке pgsql-general по дате отправления
От: Ow Mun Heng
Дата:
Сообщение: help w/ SRF function
От: Phoenix Kiula
Дата:
FAQ