Skip site navigation (1) Skip section navigation (2)

SERIAL type - auto-increment grouped by other field

From: Paulovič Michal <michal(at)paulovic(dot)sk>
To: pgsql-announce(at)postgresql(dot)org
Subject: SERIAL type - auto-increment grouped by other field
Date: 2004-02-28 17:31:21
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-announce
hi all,

I have problem with SERIAL field type (or sequence functionality).
I have table with three columns - ID, IDS, NAME.
I want auto-increment IDS grouped by ID.
1, 1, Ferdo
1, 2, John
2, 1, Martin
1, 3, Elvira
2, 2, Georgia

when I use IDS - SERIAL and when I create UNIQUE (ID, IDS) result is:
1, 1, Ferdo
1, 2, John
2, 3, Martin
1, 4, Elvira
2, 5, Georgia

where i make misstake??? how can i do it??? in documentation there is
description only for one auto-increment column. I didn't find auto increment as
I described upper.

tnx a lot

________ Information from NOD32 ________
This message was checked by NOD32 Antivirus System for Linux Mail Server.

pgsql-announce by date

Next:From: Robert TreatDate: 2004-03-01 19:04:34
Subject: == PostgreSQL Weekly News - March 1st 2004 ==
Previous:From: Chris RyanDate: 2004-02-26 21:14:58
Subject: Fwd: GBORG NEWS: 1.2.1 release (erserver)

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group