Multi row sequence?

From: "Filip Wuytack" <fwuytack(at)fgscapital(dot)com>
To: <pgsql-general(at)postgresql(dot)org>
Subject: Multi row sequence?
Date: 2004-12-17 11:10:12
Message-ID: 20041217111022.2D2FA3CC5C1@svr1.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi,

I just started looking into PostgreSQL (coming from Mysql before), but have
a question:

Is it possible to have a sequence (as a multirow prim key), where sequence
(id) only increase per group of data (grp).

E.g.
+--------+----+---------+
| grp | id | name |
+--------+----+---------+
| fish | 1 | lax |
| mammal | 1 | dog |
| mammal | 2 | cat |
| mammal | 3 | whale |
| bird | 1 | penguin |
| bird | 2 | ostrich |
+--------+----+---------+

Many thanks,

Filip

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Richard Huxton 2004-12-17 12:38:44 Re: Check if table exists
Previous Message Riccardo G. Facchini 2004-12-17 10:36:15 Re: Scheduler in Postgres