Re: "Keyed" sequence?

From: Vik Fearing <vik(at)2ndquadrant(dot)fr>
To: Israel Brewster <israel(at)ravnalaska(dot)net>, "pgsql-general(at)postgresql(dot)org general" <pgsql-general(at)postgresql(dot)org>
Subject: Re: "Keyed" sequence?
Date: 2016-04-28 18:39:19
Message-ID: 572258D7.4010304@2ndquadrant.fr
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 04/28/2016 08:30 PM, Israel Brewster wrote:
> This is probably crazy talk, but in Postgresql is there any way to have
> a "keyed" sequence? That is, I have a table with a list of departments.
> While *relatively* static, technically speaking this is a dynamic list -
> someone certainly could decide to add a department, or combine two
> departments into one new one, whatever. In any case, I would ideally
> like to have a sequence per department, but since the list is dynamic
> it's not as simple as creating 33 independent sequences and then having
> a lookup table somewhere, although I guess I could implement something
> of the sort with triggers.

What would be the point of this? Why not just one sequence for all
departments?
--
Vik Fearing +33 6 46 75 15 36
http://2ndQuadrant.fr PostgreSQL : Expertise, Formation et Support

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Israel Brewster 2016-04-28 18:48:12 Re: "Keyed" sequence?
Previous Message Israel Brewster 2016-04-28 18:30:20 "Keyed" sequence?