creating "a perfect sequence" column

From: Jack Brown <zidibik(at)yahoo(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: creating "a perfect sequence" column
Date: 2008-07-07 00:15:27
Message-ID: 574173.92396.qm@web63905.mail.re1.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Dear list,

I need some tips and/or pointers to relevant documentation implementing (what I chose to call) "a perfect sequence" i.e. a sequence that has no missing numbers in the sequence. I'd like it to auto increment on insert, and auto decrement everything bigger than its value on delete. There are many mechanisms (rules, triggers, sequences, locks etc.) but I'm not sure which combination would result in the most elegant implementation.

Oh, and if you know the right term for what I just described, I'd be more than pleased to hear it! :-)

All the best,
Jack

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Scott Marlowe 2008-07-07 01:02:30 Re: creating "a perfect sequence" column
Previous Message Tom Lane 2008-07-06 17:48:56 Re: roll back to 8.1 for PyQt driver work-around