Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id ED11B9FA158 for ; Wed, 18 Oct 2006 15:43:56 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) with ESMTP id 85038-06 for ; Wed, 18 Oct 2006 15:43:51 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from noel.decibel.org (noel.decibel.org [67.100.216.10]) by postgresql.org (Postfix) with ESMTP id 900569FA1FD for ; Wed, 18 Oct 2006 15:43:51 -0300 (ADT) Received: by noel.decibel.org (Postfix, from userid 1001) id C13B15645E; Wed, 18 Oct 2006 13:43:50 -0500 (CDT) Received: (hashcash-sendmail, from uid 1001); Wed, 18 Oct 2006 13:43:47 -0500 Date: Wed, 18 Oct 2006 13:43:47 -0500 From: "Jim C. Nasby" To: Indira Muthuswamy Cc: pgsql-sql@postgresql.org Subject: Re: [HACKERS] Bug? Message-ID: <20061018184346.GG85041@nasby.net> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Operating-System: FreeBSD 6.1-RELEASE-p10 amd64 X-Distributed: Join the Effort! http://www.distributed.net User-Agent: Mutt/1.5.13 (2006-08-11) X-Hashcash: 1:20:061018:indumuthu@gmail.com::DaCOicgIOnpEDB46:000000000000000000 0000000000000000000000001nZF X-Hashcash: 1:20:061018:pgsql-sql@postgresql.org::LH234kEBnmsKMHDx:0000000000000 0000000000000000000000004nkU X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.047 tagged_above=0 required=5 tests=AWL X-Spam-Level: X-Archive-Number: 200610/172 X-Sequence-Number: 26561 Moving to -sql. On Wed, Oct 18, 2006 at 06:53:46PM +0530, Indira Muthuswamy wrote: > Hai, > > I have encountered a problem with PostgreSQL.I have created a table > 'tab1' with a column 'a' with serial type.I entered 20 records into the > table.So the query > select max(a) from tab1; > returned 20.When I tried the same query after the command > truncate table tab1; > I found that the output of the first query as > > max > ----- > > (1 row) > When I tried to insert a new row into the table tab1 I found that the > value at column a incremented to the value 21. > But I heard from my friends that the value of the serial column gets > decremented whenever we issue the 'truncate table' command (in MS SQL > SERVER).Is the concept same with PostgreSQL or not?Can anyone clarify me on > this? Your friends are mistaken. TRUNCATE does nothing to affect sequences. -- Jim Nasby jim@nasby.net EnterpriseDB http://enterprisedb.com 512.569.9461 (cell)