Tom Lane wrote:
Michael Fuhr <[EMAIL PROTECTED]> writes:
On Tue, Dec 12, 2006 at 12:19:56PM -0500, Tom Lane wrote:
Usually you do something like
select setval('seq_name', (select max(idcol) from table) + 1);
after loading data into the table.
Is "+ 1" necessary with the t
Michael Fuhr <[EMAIL PROTECTED]> writes:
> On Tue, Dec 12, 2006 at 12:19:56PM -0500, Tom Lane wrote:
>> Usually you do something like
>> select setval('seq_name', (select max(idcol) from table) + 1);
>> after loading data into the table.
> Is "+ 1" necessary with the two-parameter form of setval
On Tue, Dec 12, 2006 at 12:19:56PM -0500, Tom Lane wrote:
> [EMAIL PROTECTED] 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
Awesome. Thanks tom.
By the way I am still trying to find a yum install for 8.2 for
centos...anyone?
> [EMAIL PROTECTED] 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 tab
[EMAIL PROTECTED] 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
-
h '||rec.m;
End loop;
END;
Return 0;
...
Cheers,
marc
-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of
[EMAIL PROTECTED]
Sent: Tuesday, December 12, 2006 5:39 PM
To: pgsql-general@postgresql.org
Subject: [GENERAL] resetting sequence to cur max value
I am migrating a system from hsqldb to postgresql. I have a bunch of
installs of this system live so moving the data is a headache. I was
using identities in hsqldb and now I am using sequences. I was able to
move all my data over however I am having an issue with the sequences. I
default them