getting at sequence previous/next values

From: Louis-David Mitterrand <vindex+lists-pgsql-sql(at)apartia(dot)org>
To: pgsql-sql(at)postgresql(dot)org
Subject: getting at sequence previous/next values
Date: 2007-02-26 18:14:51
Message-ID: 20070226181451.GA9015@apartia.fr
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Hello,

I've got a table that looks basically like:

id_show | serial
show_name | text
show_type | text
created_on | timestamp without time zone

When looking at a row with an id_show of value n, I'd like to have an
easy way of knowing the preceding and next values of id_show in the
sequence (which might have holes).

Is there some convenient way to get that info, or must I do a full-blown
select?

Thanks,

Browse pgsql-sql by date

  From Date Subject
Next Message Rodrigo De León 2007-02-26 18:43:00 Re: Change Default Database
Previous Message Rommel the iCeMAn 2007-02-26 17:22:54 Re: Change Default Database