Select setval('mytable_id_seq',1);
So when I insert a new row the value will be "2" and not "1" as it should be
Select setval('mytable_id_seq',1,false);
http://www.postgresql.org/docs/8.1/interactive/functions-sequence.html
HTH.
Ben K.
Developer
http://benix.tamu.edu
I cannot put Select setval('mytable_id_seq',0); What should I do ??!! Thx Pascal -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Sriram Dandapani Sent: Monday, May 08, 2006 11:54 PM To: Bruno Wolff III Cc: pgsql-admin@postgresql
On Tue, 9 May 2006, Pascal Tufenkji wrote:
> How can I reset the sequence to "1"
>
> If I use the following statement
>
> Select setval('mytable_id_seq',1);
>
> I put the last value as 1
>
> So when I insert a new row the value will be "2" and not "1" as it should be
>
> I cannot put Select setval
What
should I do ??!!
Thx
Pascal
-Original
Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Sriram Dandapani
Sent: Monday, May 08, 2006 11:54 PM
To: Bruno Wolff III
Cc: pgsql-admin@postgresql.org
Subject: Re: [ADMIN] reset all sequences
Thanks
Thanks..that really helped!!
-Original Message-
From: Bruno Wolff III [mailto:[EMAIL PROTECTED]
Sent: Thursday, May 04, 2006 7:44 PM
To: Sriram Dandapani
Cc: pgsql-admin@postgresql.org
Subject: Re: reset all sequences
On Thu, May 04, 2006 at 14:20:39 -0700,
Sriram Dandapani <[EMAIL PRO
On Thu, May 04, 2006 at 14:20:39 -0700,
Sriram Dandapani <[EMAIL PROTECTED]> wrote:
> Hi
>
>
>
> I have a scenario where I need to reset all sequences(about 400). Is
> there a system table that I can query to get a list of sequences
> (Postgres 8.1.x)
You can do something like:
select * from
Hi
I have a scenario where I need to reset all sequences(about
400). Is there a system table that I can query to get a list of sequences
(Postgres 8.1.x)