Posted in 1997
Terron Wright wrote: > > Can someone give me a good example of how to use the alter table > statement for resetting a serial column next number. I know that the documentation mentions that you can use ALTER TABLE to reset a serial column, but I have yet to figure it out. Instead, you should insert the maximum allowed value into the serial column and force it to cycle back to 1. You can then delete the row if you don't want it. We do this for populating databases with test data so that we can get reproducible results (ie. get the same serial values out of the database). ----------- Roger Tomas AG Communication Systems
We use strictly necessary cookies to make this site work. With your consent we’d also use optional cookies for analytics and marketing. You can accept all, reject all, or choose. Read our Cookie Policy.