We have an existing ReviewBoard setup that we're trying to migrate from an 
old MySQL infrastructure to a shiny new PostgreSQL setup.

We've gotten it to the point where the migration seems to work fine for 
reading the data out of the PostgreSQL database, and for some simple 
changes. But when we try to create new content, we get a 500 error from 
reviewboard. It looks like the sequences for generating primary keys aren't 
being updated when we run dbimport, which is causing unique constraint 
violations.

I can't find a related issue in the issue tracker, or much discussion about 
this on the Internet at large.

1. Does anyone have patch for fixing this?
2. How about a script for fixing up the sequences in PostgreSQL?
3. Anyone else have experiences migrating ReviewBoard to PostgreSQL that 
might help us out?

Here are the details, if it helps:

We're getting errors in the logs that look like:

2013-04-24 18:32:51,325 - ERROR - Exception thrown for user dlee at 
http://rbtest.digium.internal/r/new/

duplicate key value violates unique constraint 
"diffviewer_diffsethistory_pkey"
DETAIL:  Key (id)=(7) already exists.


It looks like what's happening is that the data in the database is being 
migrated successfully, but the sequences for generating primary keys are 
left unchanged.

reviewboard=# select max(id) from diffviewer_diffsethistory;
 max  
------
 2466
(1 row)

reviewboard=# \d diffviewer_diffsethistory_id_seq 
     Sequence "public.diffviewer_diffsethistory_id_seq"
    Column     |  Type   |              Value               
---------------+---------+----------------------------------
 sequence_name | name    | diffviewer_diffsethistory_id_seq
 last_value    | bigint  | 7
 start_value   | bigint  | 1
 increment_by  | bigint  | 1
 max_value     | bigint  | 9223372036854775807
 min_value     | bigint  | 1
 cache_value   | bigint  | 1
 log_cnt       | bigint  | 29
 is_cycled     | boolean | f
 is_called     | boolean | t


Thanks!
dave
<><

-- 
Want to help the Review Board project? Donate today at 
http://www.reviewboard.org/donate/
Happy user? Let us know at http://www.reviewboard.org/users/
-~----------~----~----~----~------~----~------~--~---
To unsubscribe from this group, send email to 
reviewboard+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/reviewboard?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"reviewboard" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to reviewboard+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to