pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Louis-David Mitterrand <vindex+lists-pgsql-sql@apartia.org>
To: pgsql-sql@postgresql.org
Subject: getting at sequence previous/next values
Date: Mon, 26 Feb 2007 19:14:51 +0100
Message-ID: <20070226181451.GA9015@apartia.fr> (raw)

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,



Message-ID: <20070226181451.GA9015@apartia.fr>
Permalink:  ../20070226181451.GA9015@apartia.fr/
Also on:    postgresql.org/message-id/20070226181451.GA9015@apartia.fr

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: vindex+lists-pgsql-sql@apartia.org
  Subject: Re: getting at sequence previous/next values
  In-Reply-To: <20070226181451.GA9015@apartia.fr>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox