Received: from localhost (maia-4.hub.org [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id C7F689FB85B for ; Thu, 12 Jul 2007 21:58:30 -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 03990-05 for ; Thu, 12 Jul 2007 21:58:24 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from lists.commandprompt.com (host-254.commandprompt.net [207.173.203.254]) by postgresql.org (Postfix) with ESMTP id C4EC39FB738 for ; Thu, 12 Jul 2007 21:58:27 -0300 (ADT) Received: from perhan.alvh.no-ip.org (201-221-218-82.bk12-dsl.surnet.cl [201.221.218.82]) (authenticated bits=0) by lists.commandprompt.com (8.13.7/8.13.6) with ESMTP id l6D0wPLa016482; Thu, 12 Jul 2007 17:58:26 -0700 Received: by perhan.alvh.no-ip.org (Postfix, from userid 1000) id D486247C46; Thu, 12 Jul 2007 20:58:19 -0400 (CLT) Date: Thu, 12 Jul 2007 20:58:19 -0400 From: Alvaro Herrera To: Harpreet Dhaliwal Cc: Tom Allison , Postgres General Subject: Re: Duplicate Unique Key constraint error Message-ID: <20070713005819.GC474@alvh.no-ip.org> References: <469320CA.9080406@shaw.ca> <5288.1184094554@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.5.16 (2007-06-11) X-Virus-Scanned: ClamAV 0.90.3/3641/Wed Jul 11 18:57:08 2007 on projects.commandprompt.com X-Virus-Status: Clean X-Greylist: Sender succeded SMTP AUTH authentication, not delayed by milter-greylist-1.6 (lists.commandprompt.com [192.168.2.159]); Thu, 12 Jul 2007 17:58:26 -0700 (PDT) X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200707/529 X-Sequence-Number: 117130 Harpreet Dhaliwal escribió: > How can one rollover a sequence back to zero after you delete records from > a > table with one such sequence. > I see it starting with the last value of the sequence inserted. You can use setval(), but normally you just leave it alone. Having numbers not starting from 0 is not a problem in most cases. -- Alvaro Herrera http://www.flickr.com/photos/alvherre/ Hi! I'm a .signature virus! cp me into your .signature file to help me spread!