| From: | "David Stanaway" <David(at)Stanaway(dot)net> | 
|---|---|
| To: | <pgsql-general(at)postgresql(dot)org>, <pgsql-sql(at)postgresql(dot)org> | 
| Subject: | Re: [SQL] resetting sequence | 
| Date: | 2002-03-27 07:06:37 | 
| Message-ID: | 001201c1d55d$f14b4000$0108a8c0@automaton | 
| Views: | Whole Thread | Raw Message | Download mbox | Resend email | 
| Thread: | |
| Lists: | pgsql-general pgsql-sql | 
----- Original Message -----
From: Kancha . <kancha2np(at)yahoo(dot)com>
To: <pgsql-general(at)postgresql(dot)org>; <pgsql-sql(at)postgresql(dot)org>
Sent: Tuesday, March 26, 2002 8:30 PM
Subject: [SQL] resetting sequence
> My sequence starts from 1 and after few months it
> should be reset to 1 again. Can this be automated ??
If the use of the sequence is predictable, you may want to alter the CYCLE
and MAXVALUE options in the seqence creation.
EG:
CREATE SEQUENCE foo MAXVALUE 3000 CYCLE;
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Medi Montaseri | 2002-03-27 07:06:50 | Re: Test data sets | 
| Previous Message | Jeff Davis | 2002-03-27 06:02:11 | Suggestion for table/index structure? | 
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Achilleus Mantzios | 2002-03-27 07:23:32 | Re: Arrays Design Question | 
| Previous Message | Philip Hallstrom | 2002-03-27 05:30:10 | Re: resetting sequence |