Received: from localhost (maia-5.hub.org [200.46.204.182]) by postgresql.org (Postfix) with ESMTP id 9CEE59FB86F for ; Tue, 17 Jul 2007 11:19:13 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.182]) (amavisd-maia, port 10024) with ESMTP id 09441-07 for ; Tue, 17 Jul 2007 11:19:02 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.5 Received: from web31812.mail.mud.yahoo.com (web31812.mail.mud.yahoo.com [68.142.207.75]) by postgresql.org (Postfix) with SMTP id A73459FB354 for ; Tue, 17 Jul 2007 11:19:07 -0300 (ADT) Received: (qmail 28078 invoked by uid 60001); 17 Jul 2007 14:19:05 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=X-YMail-OSG:Received:Date:From:Subject:To:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding:Message-ID; b=p5qV0Tnn7SmMNF1kXulxwCSUoJoXd9htEDk/Z8jCU39hPqVatlWEICz3tEHTghqEMqOsXDxVnACaXNic6wLzo3iG4KfomZNSDhJJPkWOY0qsXQ5HlxUH0JOgWYAJxPY/siqy2dGgbQkBl5pPSkw1F3IoyMx8mVPNHQVtw/R4QZY=; X-YMail-OSG: mFU6ErcVM1nLYNp1PA6o0CqT90GqWjreNgka81iMTZxzC3DaGcIttOsglrHZjoRbxsKO1LWnzW5vVteu7cGMvNHKUGea_oH35ECCFF3k2v_QWtcw3GQ- Received: from [12.180.237.138] by web31812.mail.mud.yahoo.com via HTTP; Tue, 17 Jul 2007 07:19:05 PDT Date: Tue, 17 Jul 2007 07:19:05 -0700 (PDT) From: Richard Broersma Jr Subject: Re: data dependent sequences? To: Stuart , pgsql-sql@postgresql.org In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Message-ID: <851996.28057.qm@web31812.mail.mud.yahoo.com> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.275 tagged_above=0 required=5 tests=AWL=0.274, BAYES_50=0.001 X-Spam-Level: X-Archive-Number: 200707/100 X-Sequence-Number: 28835 --- Stuart wrote: > > you will need to use pre insert trigger since you cannot use column > > references in default expression. > > > > you could use this same trigger to either: > > - create sequences as needed and apply the right one > > - with locking, lookup for last id of typ > > - with locking, keep another table of typ and nextval here is supplementary information of gap-less sequences: http://www.varlena.com/GeneralBits/130.php Regards, Richard Broersma Jr.