Resetting SEQUENCEs

Поиск
Список
Период
Сортировка
От Laurent ROCHE
Тема Resetting SEQUENCEs
Дата
Msg-id 314407.22600.qm@web34403.mail.mud.yahoo.com
обсуждение исходный текст
Ответы Re: Resetting SEQUENCEs
Re: Resetting SEQUENCEs
Re: Resetting SEQUENCEs
Список pgsql-general
Hi,

I am quite surprised I could not find a way to automatically reset the value of a sequence for all my tables.

Of course, I can write:
SELECT setval('serial', max(id)) FROM distributors
But if I reload data into all my tables, it's a real pain to have to write something like this for every single table with a sequence.

I would expect PostgreSQL to provide some command like:
resynchAllSequences my_schema;

Can this be a feature in the future ?

Does anybody have a solution for now ? A script or (even better) a pl/pgSql function ?
 

Cheers,
L@u
The Computing Froggy




Ne gardez plus qu'une seule adresse mail ! Copiez vos mails vers Yahoo! Mail

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

Предыдущее
От: Lothar Behrens
Дата:
Сообщение: Re: Am I overseen ?
Следующее
От: Shane Ambler
Дата:
Сообщение: Re: Problem of installation on Mac