Re: Multi row sequence? - Mailing list pgsql-general

From Ciprian Popovici
Subject Re: Multi row sequence?
Date
Msg-id 20041219150227.50bc43ad@xxx
Whole thread Raw
In response to Re: Multi row sequence?  (Bruno Wolff III <bruno@wolff.to>)
Responses Re: Multi row sequence?
Re: Multi row sequence?
List pgsql-general
On Sat, 18 Dec 2004 11:07:37 -0600 Bruno Wolff III <bruno@wolff.to> wrote:
> On Fri, Dec 17, 2004 at 11:10:12 -0000,
>   Filip Wuytack <fwuytack@fgscapital.com> wrote:
> > Is it possible to have a sequence (as a multirow prim key), where
> > sequence (id) only increase per group of data (grp).
>
> Why do you want to do this? It would be a lot simpler to generate unique
> values over the table and that will work just fine if all you need
> is uniqueness.

Here's a case where what he said would come in handy: arranging a
particular display order within the individual groups. You have the unique
key for the entire table, but you need something like a serial restricted
to just a group of rows.


--
Ciprian Popovici

pgsql-general by date:

Previous
From: Együd Csaba
Date:
Subject: PG8 final when
Next
From: Vitaly Belman
Date:
Subject: A "cascade on delete" constraints deletes AFTER the source is gone??