pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: missive@frontiernet.net
To: pgsql-admin@postgresql.org
Subject: Re: Reset sequence number
Date: Sat, 23 Feb 2002 17:07:34 +0000 (UTC)
Message-ID: <slrna7fiul.5v.missive@whave.frontiernet.net> (raw)
References: <3C777F09.854C8FD4@nospan_hotmail.com>

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




view thread (4+ messages)  latest in thread

Message-ID: <slrna7fiul.5v.missive@whave.frontiernet.net>
Permalink:  ../slrna7fiul.5v.missive@whave.frontiernet.net/
Also on:    postgresql.org/message-id/slrna7fiul.5v.missive@whave.frontiernet.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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-admin@postgresql.org
  Cc: missive@frontiernet.net
  Subject: Re: Reset sequence number
  In-Reply-To: <slrna7fiul.5v.missive@whave.frontiernet.net>
  References: <3C777F09.854C8FD4@nospan_hotmail.com> <slrna7fiul.5v.missive@whave.frontiernet.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