Search Postgresql Archives

Re: stored procs

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

 



On 09/30/11 1:13 AM, J.V. wrote:
thanks for the help, we have a production schema with 80 tables and a few of the tables have consumed the max limit for the id field, so I have to write a program (stored functions would be the fastest way to do this), that will go and drop the sequence, create & start at 1 again, and re-sequence every table and then make sure all the foreign keys in every table point to where they are supposed to.

you shouldn't have to drop the sequence, just setval('sequencename',max(idfield)+1); after resequencing the ID's with a generate_series... ...

or, convert the fields to bigint which are 64 bit and not likely to wrap around any time in this century.... (sequences already use bigint)



--
john r pierce                            N 37, W 122
santa cruz ca                         mid-left coast


--
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


[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