Re: [GENERAL] Sequence reset

2010-08-23 Thread Rikard Bosnjakovic
On Mon, Aug 23, 2010 at 12:04, SUNDAY A. OLUTAYO wrote: > How can I reset a sequence column due to deletion of some rolls? ALTER SEQUENCE sequence_name RESTART 1; -- - Rikard -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://w

Re: [GENERAL] Sequence reset

2010-08-23 Thread Randall Smith
I can't tell what a roll is based on your question, but here is how to set a sequence to a specific value. SELECT setval('foo', 42); Next nextval will return 43 http://www.postgresql.org/docs/8.4/interactive/functions-sequence.html -Randall On Mon, 2010-08-23 at 05:04 -0500, SUNDAY A.

Re: [GENERAL] Sequence reset

2010-08-23 Thread Scott Marlowe
On Mon, Aug 23, 2010 at 4:04 AM, SUNDAY A. OLUTAYO wrote: > How can I reset a sequence column due to deletion of some rolls? Note that a design of a column that holds the output of a sequence and can't handle gaps is pretty much broken. -- Sent via pgsql-general mailing list (pgsql-general@post

Re: [GENERAL] Sequence reset

2010-08-23 Thread Raymond O'Donnell
On 23/08/2010 11:04, SUNDAY A. OLUTAYO wrote: > How can I reset a sequence column due to deletion of some rolls? You can use the setval() function to set its value to whatever you like: http://www.postgresql.org/docs/8.4/static/functions-sequence.html HTH Ray. -- Raymond O'Donnell :: Galway