Re: reset sequence - Mailing list pgsql-sql

From Michael Paesold
Subject Re: reset sequence
Date
Msg-id 005001c25a47$30700220$4201a8c0@beeblebrox
Whole thread Raw
In response to Re: reset sequence  (Ludwig Lim <lud_nowhere_man@yahoo.com>)
List pgsql-sql
Ludwig Lim wrote:

> --- Ricardo Javier Aranibar León
> <ricardo_jal@hotmail.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




pgsql-sql by date:

Previous
From: Ludwig Lim
Date:
Subject: Re: reset sequence
Next
From: "Michael Paesold"
Date:
Subject: Re: Rules and Triggers: another question