Re: How to reset a sequence so it will start with 1 again?

From: Michael Glaesemann <grzm(at)myrealbox(dot)com>
To: Nico Grubert <nicogrubert(at)gmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: How to reset a sequence so it will start with 1 again?
Date: 2006-01-13 08:18:20
Message-ID: D9793622-B709-4B16-86CC-A4A33250F2BA@myrealbox.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Jan 13, 2006, at 17:02 , Nico Grubert wrote:
> SELECT setval('tblperson_id_seq', 1);

> Any idea, how I can reset the sequence so it will start with 1 again?

Take a look at the docs, in particular the three-parameter version of
setval and the is_called flag.
http://www.postgresql.org/docs/current/interactive/functions-
sequence.html

Michael Glaesemann
grzm myrealbox com

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message H.J. Sanders 2006-01-13 08:30:22 Plans for 8.2?
Previous Message Nico Grubert 2006-01-13 08:02:17 How to reset a sequence so it will start with 1 again?