pg.ddx.io pgsql-sql@postgresql.org mailing list archive
help / color / mirror / Atom feedresetting sequence
4+ messages / 4 participants
[nested] [flat]
* resetting sequence
@ 2002-03-27 02:30 Kancha . <kancha2np@yahoo.com>
0 siblings, 2 replies; 4+ messages in thread
From: Kancha . @ 2002-03-27 02:30 UTC (permalink / raw)
To: pgsql-general@postgresql.org; pgsql-sql
My sequence starts from 1 and after few months it
should be reset to 1 again. Can this be automated ??
__________________________________________________
Do You Yahoo!?
Yahoo! Movies - coverage of the 74th Academy Awards®
http://movies.yahoo.com/
^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: resetting sequence
@ 2002-03-27 05:30 Philip Hallstrom <philip@adhesivemedia.com>
parent: Kancha . <kancha2np@yahoo.com>
1 sibling, 1 reply; 4+ messages in thread
From: Philip Hallstrom @ 2002-03-27 05:30 UTC (permalink / raw)
To: Kancha . <kancha2np@yahoo.com>; +Cc: pgsql-sql
take a look at the SETVAL function... it's something close to:
SELECT SETVAL('sequence_name', 1);
something like that. check the manual.
On Tue, 26 Mar 2002, Kancha . wrote:
> My sequence starts from 1 and after few months it
> should be reset to 1 again. Can this be automated ??
>
> __________________________________________________
> Do You Yahoo!?
> Yahoo! Movies - coverage of the 74th Academy Awards®
> http://movies.yahoo.com/
>
> ---------------------------(end of broadcast)---------------------------
> TIP 5: Have you checked our extensive FAQ?
>
> http://www.postgresql.org/users-lounge/docs/faq.html
>
^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: [SQL] resetting sequence
@ 2002-03-27 07:06 David Stanaway <David@Stanaway.net>
parent: Kancha . <kancha2np@yahoo.com>
1 sibling, 0 replies; 4+ messages in thread
From: David Stanaway @ 2002-03-27 07:06 UTC (permalink / raw)
To: pgsql-general@postgresql.org; pgsql-sql
----- Original Message -----
From: Kancha . <kancha2np@yahoo.com>
To: <pgsql-general@postgresql.org>; <pgsql-sql@postgresql.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;
^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: [SQL] resetting sequence
@ 2002-03-27 15:07 Andrew G. Hammond <drew@xyzzy.dhs.org>
parent: Philip Hallstrom <philip@adhesivemedia.com>
0 siblings, 0 replies; 4+ messages in thread
From: Andrew G. Hammond @ 2002-03-27 15:07 UTC (permalink / raw)
To: Philip Hallstrom <philip@adhesivemedia.com>; +Cc: Kancha . <kancha2np@yahoo.com>; pgsql-general@postgresql.org; pgsql-sql
It also looks like you might want to check out the unix cron utility.
From your shell prompt, try
man crontab
On Tue, Mar 26, 2002 at 09:30:10PM -0800, Philip Hallstrom wrote:
> take a look at the SETVAL function... it's something close to:
>
> SELECT SETVAL('sequence_name', 1);
>
> something like that. check the manual.
>
> On Tue, 26 Mar 2002, Kancha . wrote:
>
> > My sequence starts from 1 and after few months it
> > should be reset to 1 again. Can this be automated ??
> >
> > __________________________________________________
> > Do You Yahoo!?
> > Yahoo! Movies - coverage of the 74th Academy Awards®
> > http://movies.yahoo.com/
> >
> > ---------------------------(end of broadcast)---------------------------
> > TIP 5: Have you checked our extensive FAQ?
> >
> > http://www.postgresql.org/users-lounge/docs/faq.html
> >
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 2: you can get off all lists at once with the unregister command
> (send "unregister YourEmailAddressHere" to majordomo@postgresql.org)
--
Andrew G. Hammond mailto:drew@xyzzy.dhs.org http://xyzzy.dhs.org/~drew/
56 2A 54 EF 19 C0 3B 43 72 69 5B E3 69 5B A1 1F 613-389-5481
5CD3 62B0 254B DEB1 86E0 8959 093E F70A B457 84B1
"To blow recursion you must first blow recur" -- me
^ permalink raw reply [nested|flat] 4+ messages in thread
end of thread, other threads:[~2002-03-27 15:07 UTC | newest]
Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2002-03-27 02:30 resetting sequence Kancha . <kancha2np@yahoo.com>
2002-03-27 05:30 ` Philip Hallstrom <philip@adhesivemedia.com>
2002-03-27 15:07 ` Andrew G. Hammond <drew@xyzzy.dhs.org>
2002-03-27 07:06 ` David Stanaway <David@Stanaway.net>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox