pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Andrew Dunstan <andrew@dunslane.net>
To: Indira Muthuswamy <indumuthu@gmail.com>
Cc: pgsql-hackers@postgresql.org
Subject: Re: Bug?
Date: Wed, 18 Oct 2006 09:31:54 -0400
Message-ID: <45362CCA.8060000@dunslane.net> (raw)
In-Reply-To: <e1a645540610180623s2d3bf652k7fee992947a65903@mail.gmail.com>
References: <e1a645540610180623s2d3bf652k7fee992947a65903@mail.gmail.com>

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?
>  

Sure. You heard wrong about postgres.

Please do not ask questions like this on the -hackers list - this should 
have gone to pgsql-general. The hackers list is for postgresql 
development discussions only.

cheers

andrew



view thread (10+ messages)  latest in thread

Message-ID: <45362CCA.8060000@dunslane.net>
Permalink:  ../45362CCA.8060000@dunslane.net/
Also on:    postgresql.org/message-id/45362CCA.8060000@dunslane.net

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: andrew@dunslane.net, indumuthu@gmail.com, pgsql-hackers@postgresql.org
  Subject: Re: Bug?
  In-Reply-To: <45362CCA.8060000@dunslane.net>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox