Re: reset sequence

From: "Michael Paesold" <mpaesold(at)gmx(dot)at>
To: Ricardo Javier Aranibar León <ricardo_jal(at)hotmail(dot)com>
Cc: "Postgresql Mailing List" <pgsql-sql(at)postgresql(dot)org>
Subject: Re: reset sequence
Date: 2002-09-12 10:28:50
Message-ID: 005001c25a47$30700220$4201a8c0@beeblebrox
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Ludwig Lim wrote:

> --- Ricardo Javier Aranibar León
> <ricardo_jal(at)hotmail(dot)com> wrote:
> > Hi List,
> >
> > I need that somebody help me.
> > First, I use PostgreSQL 7.0.3 for linux.
> > I need reset my sequence but that it begin in 1
> > again when a use nextval.
> > And I have been search in
> > http://archives.postgresql.org/ about reset
> > sequence but I obtain this information:
> > SELECT setval('name_sequence', 1, false);
>
> try SELECT setval('name_sequence',1);

That will probably set the current value to 1, which will result in a
nextval of 2, which is perhaps not what Ricardo wanted.

> Maybe setval(<text>,<bigint>,<bool>) doesn't exist in
> 7.0.3.

\df setval
in psql should output all possible parameter combinations for setval.

Regards,
Michael Paesold

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Michael Paesold 2002-09-12 12:52:47 Re: Rules and Triggers: another question
Previous Message Ludwig Lim 2002-09-12 10:12:13 Re: reset sequence