"Keyed" sequence?
| От | Israel Brewster |
|---|---|
| Тема | "Keyed" sequence? |
| Дата | |
| Msg-id | 2926B083-33C9-4648-8635-BC293C70ED45@ravnalaska.net обсуждение исходный текст |
| Ответы |
Re: "Keyed" sequence?
Re: "Keyed" sequence? |
| Список | pgsql-general |
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.
Is there any elegant way of accomplishing this? Something like SELECT nextval('department_seq['ops'])?
-----------------------------------------------
Israel Brewster
Systems Analyst II
Ravn Alaska
5245 Airport Industrial Rd
Fairbanks, AK 99709
(907) 450-7293
-----------------------------------------------
Вложения
В списке pgsql-general по дате отправления: