How to find Missing Sequences - Mailing list pgsql-general

From Madhavi Daroor
Subject How to find Missing Sequences
Date
Msg-id NHBBKMLNGKEMDMCGAMFNGEKCCAAA.madhavi@zoniac.com
Whole thread Raw
Responses Re: How to find Missing Sequences  (greg@turnstep.com)
List pgsql-general
I have a problem here.....I need to get a list of sequence ids of a
particular sequence. What I mean by this is....I have a table that has
say...15 records....and I'm using a sequence for the primary key of that
table. Now the values of the primary key is 1 to 10 for the 1st 10 records.
And then since the sequence has beed skipped or some other problem...the
11th record begins with 16 as the value for the primary key. So the next 5
records have primarykeys with values 16 to 20 instead of 11 to 15.

Now I want an sql statement that can fetch me a list of all these skipped
sequence id...ie, from 11 to 15. How do I do that? Or Is there any other way
(other than looping through the numbers)to find these values?

Thanx
Madhavi


pgsql-general by date:

Previous
From: "Mattias Kregert"
Date:
Subject: Re: [pgsql-advocacy] MySQL gets $19.5 MM
Next
From: "Andreas Schönbach"
Date:
Subject: Large Objects in serializable transaction question