Skip site navigation (1) Skip section navigation (2)

Re: Reset sequence number

From: missive(at)frontiernet(dot)net (Lee Harr)
To: pgsql-admin(at)postgresql(dot)org
Subject: Re: Reset sequence number
Date: 2002-02-23 17:07:34
Message-ID: slrna7fiul.5v.missive@whave.frontiernet.net (view raw or flat)
Thread:
Lists: pgsql-admin
> How can I reset a sequence number back to 0 ?
> 

SELECT setval('sequence_name', 0);


In order for this to work, the sequence must have been created with
a MINVALUE of 0 (the default MINVALUE is 1)

CREATE SEQUENCE sequence_name MINVALUE 0;


In response to

Responses

pgsql-admin by date

Next:From: Peter EisentrautDate: 2002-02-23 17:18:14
Subject: Re: psql --single-step mode doesn't like empty sets
Previous:From: Ivan il TerribileDate: 2002-02-23 12:51:10
Subject: Re: passing argument ro a trigger

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group