Received: from localhost (maia-4.hub.org [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id 0291C9FA6B5 for ; Sun, 15 Jul 2007 13:01:55 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 58221-06 for ; Sun, 15 Jul 2007 13:01:44 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from mx1.ipf.is (mack.ipf.is [85.197.192.164]) by postgresql.org (Postfix) with ESMTP id 499B59FB287 for ; Sun, 15 Jul 2007 13:01:51 -0300 (ADT) Received: (qmail 19965 invoked by uid 1010); 15 Jul 2007 16:02:01 +0000 Received: from 88.149.106.19 by mack (envelope-from , uid 1008) with qmail-scanner-1.25-st-qms (clamdscan: 0.88.4/1639. spamassassin: 3.1.4. perlscan: 1.25-st-qms. Clear:RC:1(88.149.106.19):SA:0(-2.4/4.5):. Processed in 0.523939 secs); 15 Jul 2007 16:02:01 -0000 X-Antivirus-HIVE-Mail-From: gnari@hive.is via mack X-Antivirus-HIVE: 1.25-st-qms (Clear:RC:1(88.149.106.19):SA:0(-2.4/4.5):. Processed in 0.523939 secs Process 19957) Received: from dsl-149-106-19.hive.is (HELO ?192.168.1.33?) (88.149.106.19) by mx1.ipf.is with SMTP; 15 Jul 2007 16:02:01 +0000 Subject: Re: data dependent sequences? From: Ragnar To: Stuart McGraw Cc: pgsql-sql@postgresql.org In-Reply-To: References: Content-Type: text/plain Date: Sun, 15 Jul 2007 16:04:56 +0000 Message-Id: <1184515497.5778.141.camel@localhost.localdomain> Mime-Version: 1.0 X-Mailer: Evolution 2.8.1 Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200707/89 X-Sequence-Number: 28824 On sun, 2007-07-15 at 09:28 -0600, Stuart McGraw wrote: > Advice requested :-) I have a table like: > > CREATE TABLE items ( > id INT, > typ INT ... > PRIMAY KEY (seq,typ)); > > I would like 'id' to be like a SERIAL except that I > want independent sequences for each value of 'typ'. what possible advantage could there be to that? if you need gapless series, then sequences (and serial) are not adequate anyways. just use one sequence. gnari