Search Postgresql Archives

Re: Resetting SEQUENCEs

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thursday 18 October 2007, Laurent ROCHE <laurent_roche@xxxxxxxxx> wrote:
> 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 distributorsBut 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 ?
>

Restoring backups normally will set sequences to the correct values; you're 
doing something wrong if yours are not.




---------------------------(end of broadcast)---------------------------
TIP 3: Have you checked our extensive FAQ?

               http://www.postgresql.org/docs/faq

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux