How to find Missing Sequences

Поиск
Список
Период
Сортировка
От Madhavi Daroor
Тема How to find Missing Sequences
Дата
Msg-id NHBBKMLNGKEMDMCGAMFNGEKCCAAA.madhavi@zoniac.com
обсуждение исходный текст
Ответы Re: How to find Missing Sequences  (greg@turnstep.com)
Список 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 по дате отправления:

Предыдущее
От: "Mattias Kregert"
Дата:
Сообщение: Re: [pgsql-advocacy] MySQL gets $19.5 MM
Следующее
От: "Andreas Schönbach"
Дата:
Сообщение: Large Objects in serializable transaction question