Re: question about auto increment like

From: Josh Berkus <josh(at)agliodbs(dot)com>
To: pknoob(at)noos(dot)fr
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: question about auto increment like
Date: 2003-04-04 00:51:18
Message-ID: 200304031651.18884.josh@agliodbs.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

pat,

> >>What do these numbers represent? If we're talking about
> >>a key for the table,
> >>that's such a bad idea I won't help you with it. If
> >>we're talking about
> >>something else (like an entry sequence number) there are
> >>a few ways to do it,
> >>but an auto-increment number (e.g. SERIAL) isn't one of
> >>them.
>
> indeed it is a entry sequence number, not a key.

You will need a trigger to keep it sequential, then. I have a set of
triggers that does this for an ordered set of entries in a table. Keep in
mind that this will make deletes from the table really slow, as all of the
entries higher than the deleted row will have to be adjusted.

Unfortunately, I'm in the middle of a large data conversion right now; please
pester me in a week and I'll get you the triggers. Or maybe someone else
will post something.

--
-Josh Berkus
Aglio Database Solutions
San Francisco

Browse pgsql-novice by date

  From Date Subject
Next Message Josh Berkus 2003-04-04 00:55:31 Re: ERROR: More than one tuple returned by a subselect used as an expression.
Previous Message Josh Berkus 2003-04-04 00:01:12 Re: question about auto increment like