Re: [HACKERS] Bug?

From: "Jim C(dot) Nasby" <jim(at)nasby(dot)net>
To: Indira Muthuswamy <indumuthu(at)gmail(dot)com>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: [HACKERS] Bug?
Date: 2006-10-18 18:43:47
Message-ID: 20061018184346.GG85041@nasby.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-sql

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(at)nasby(dot)net
EnterpriseDB http://enterprisedb.com 512.569.9461 (cell)

In response to

  • Bug? at 2006-10-18 13:23:46 from Indira Muthuswamy

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Jeff Davis 2006-10-18 18:52:06 Re: bug or feature, || -operator and NULLs
Previous Message Martijn van Oosterhout 2006-10-18 18:43:32 Re: bug or feature, || -operator and NULLs

Browse pgsql-sql by date

  From Date Subject
Next Message Jim C. Nasby 2006-10-18 23:18:37 Re: hi i want help on levels
Previous Message Andy 2006-10-18 13:49:32 plpgsql record as parameter ???