From: | "Gregory Williamson" <Gregory(dot)Williamson(at)digitalglobe(dot)com> |
---|---|
To: | "Joshua D(dot) Drake" <jd(at)commandprompt(dot)com>, "Martin" <martin(at)cornhobble(dot)com> |
Cc: | <pgsql-general(at)postgresql(dot)org> |
Subject: | Re: Setting Sequence Values |
Date: | 2007-12-22 01:14:43 |
Message-ID: | 8B319E5A30FF4A48BE7EEAAF609DB233015E3125@COMAIL01.digitalglobe.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
Joshua Drake spake thusly:
>
> On Fri, 21 Dec 2007 23:57:21 -0000
> Martin <martin(at)cornhobble(dot)com> wrote:
>
> > After porting tables and data from FrontBase I now find that I
> > need to update all the values for the sequences that were created
> > to reflect the data in the tables. Is there an easy way to do
> > this?
>
> Take a look at setval.
>
> postgres=# select setval('foo_id_seq',(select max(id) from foo));
> setval
> - --------
> 100
> (1 row)
<...>
I think the OP needs a way to do _all_ of the sequences, which can be a little dauning if you have lots of tables. I'm sure there's a way but I haven't the time to puzzle it out -- off to SF for a(n) (im)moderate celebration. I might hack at this later tonight if I am capable.
Cheers!
Greg Williamson
Senior DBA
GlobeXplorer LLC, a DigitalGlobe company
Confidentiality Notice: This e-mail message, including any attachments, is for the sole use of the intended recipient(s) and may contain confidential and privileged information and must be protected in accordance with those provisions. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply e-mail and destroy all copies of the original message.
(My corporate masters made me say this.)
From | Date | Subject | |
---|---|---|---|
Next Message | Martin | 2007-12-22 01:45:44 | Re: Setting Sequence Values |
Previous Message | Joshua D. Drake | 2007-12-22 01:10:55 | Re: Setting Sequence Values |