Re: resetting sequence to cur max value

From: developer(at)wexwarez(dot)com
To: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: resetting sequence to cur max value
Date: 2006-12-12 17:22:41
Message-ID: 4135.192.168.1.235.1165944161.squirrel@mail.wexwarez.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Awesome. Thanks tom.

By the way I am still trying to find a yum install for 8.2 for
centos...anyone?

> developer(at)wexwarez(dot)com writes:
>> Is there a way to set it up so it knows to skip past existing ids?
>
> Usually you do something like
>
> select setval('seq_name', (select max(idcol) from table) + 1);
>
> after loading data into the table.
>
> regards, tom lane
>

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2006-12-12 17:25:22 Re: date comparisons
Previous Message Richard Huxton 2006-12-12 17:22:16 Re: date comparisons