Re: sequences; was Re: Text Reports query
Vincent Danen <[email protected]> Fri, 12 Dec 2003 14:09:49 -0700
| Newsgroups | gmane.comp.bug-tracking.anthill.devel |
|---|---|
| Message-ID | <[email protected]> |
On Dec 12, 2003, at 13:20, Vincent Danen wrote:
>>> Well, this is a little annoying. I can import everything except the
>>> bugdesc table... not sure what's going on there. I keep getting
>>> pg_atoi errors saying it can't parse what is the text field. Need
>>> to dig a little further.
>>
>> Aaarg. Found the problem. mysqldump is doing stuff like:
>>
>> INSERT INTO bugdesc VALUES (bla)
>>
>> and the dump is putting the system field after the description text
>> field wheras in pgsql the system field comes first (this is from an
>> old db).
>>
>> Can't seem to find a way to make mysqldump explicitly give the table
>> info in the insert clause, ie:
>>
>> INSERT INTO bugdesc (cols) VALUES (bla)
>>
>> A bit of a nuisance.
>
> Ok... does anyone know how to manually set a sequence in postgres?
> I've got all the data imported, which is good. The downside is that
> each sequence is set to 1 which is not good.
>
> For instances, bugs_bid_seq should be set to 342, but it's set to 1.
> I can't drop the sequence because postgres tells me that "table bugs
> column bid requires it" and suggests I drop bugs.bid instead.
>
> I tried to do something like:
>
> update sequence bugs_bid_seq set last_value = '342';
>
> but i get a parser error.
>
> Any ideas?
Nevermind... found it out.
SELECT setval('bugs_bid_seq', 342);
and then the same for each other sequence.
---
MandrakeSoft Security; http://www.mandrakesecure.net/
Online Security Resource Book; http://linsec.ca/
"lynx -source http://linsec.ca/vdanen.asc | gpg --import"
{FE6F2AFD : 88D8 0D23 8D4B 3407 5BD7 66F9 2043 D0E5 FE6F 2AFD}
_______________________________________________
Anthill-workers mailing list
Anthill-workers-+mQDA36h6dWw5LPnMra/[email protected]
http://vmlinuz.ca/mailman/listinfo/anthill-workers
PGP.sig
(application/pgp-signature, 186 B) - not displayed