reindexing sequences

Started by mikeabout 25 years ago3 messagesgeneral
Jump to latest
#1mike
matrix@quadrent.net

is there a way to reindex a sequence?
if so how and is it in the curent docs?

Mike

#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: mike (#1)
Re: reindexing sequences

"mike" <matrix@quadrent.net> writes:

is there a way to reindex a sequence?

Sequences don't have indexes, so they don't need reindexing.

regards, tom lane

#3Richard Huxton
dev@archonet.com
In reply to: mike (#1)
Re: reindexing sequences

From: "mike" <matrix@quadrent.net>

is there a way to reindex a sequence?
if so how and is it in the curent docs?

Mike

Reindex a sequence? Not sure what you mean by that. You can set the value to
something else:

select setval('mysequence',12345);

If you mean compact the values used so there aren't any gaps in the
sequence - no there's nothing that does that. There's not really any way for
Postgres to know what you've done with the sequence values.

- Richard Huxton