Finding missing values in sequence column

From: Lukasz Brodziak <lukasz(dot)brodziak(at)gmail(dot)com>
To: pgsql-admin(at)postgresql(dot)org
Subject: Finding missing values in sequence column
Date: 2010-12-30 11:19:12
Message-ID: AANLkTinVg69x_2_E8G2=Q8V5+cduTVzYKSDUzQoTigCh@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

Hello,

I have a problem with writing a select statement that would return
records for which difference in values of this and following ID is
bigger than 1. Example table
ID Data
1 Text
2 Text2
5 Text5
23 Text23
24 TXT
25 RRRR

So I need to return rows with IDs 2,5,23.
--
Łukasz Brodziak
"What if everyting around You isn't quite as it seems,
What if all the world You think You know is an inelaborate dream
When You look at Your reflection is that all you want it to be
What if You could look right through the cracks
Would You find Yourself...... Find Yourself afraid to see"

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Szymon Guz 2010-12-30 11:48:31 Re: Finding missing values in sequence column
Previous Message Imre Oolberg 2010-12-30 11:03:42 pg v. 8.4.5 misses objects and data after restoring from backup using wal