Re: Migration problem - serial fields

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: rick(at)planetdigital(dot)com (Rick)
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Migration problem - serial fields
Date: 2002-03-07 17:59:21
Message-ID: 11808.1015523961@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

rick(at)planetdigital(dot)com (Rick) writes:
> Obviously my transfer did not update the sequence used by the serial
> field -- it's still stuck at 1. However, I'm just not sure of the
> best course of action.

No, it wouldn't. After you transfer the data, advance the sequence
with something like

SELECT setval('seqname', (SELECT max(serialcol) FROM table));

and then you're good to go.

regards, tom lane

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Len Morgan 2002-03-07 18:45:47 Re: Temp Tables
Previous Message Bruce Momjian 2002-03-07 17:58:27 Re: Temp Tables