Status: New
Owner: ----
Labels: Type-Defect Priority-Medium
New issue 2962 by [email protected]: Migrating from MySQL to PostgreSQL
fails to properly initialize sequences
http://code.google.com/p/reviewboard/issues/detail?id=2962
What version are you running?
1.7.6
What's the URL of the page containing the problem?
/r/new/
What steps will reproduce the problem?
1. Install ReviewBoard with MySQL database backend
2. Use rb-site manage ${OLD_SITE} dumpdb to dump the database
3. Install ReviewBoard with PostgreSQL database backend
4. TRUNCATE django_content_type CASCADE
5. TRUNCATE django_content_type CASCADE
6. rb-site manage ${NEW_SITE} loaddb dumpdb.json
7. Try to add a comment, create a review, etc.
What is the expected output? What do you see instead?
If should add the comment or create the review. Instead there's a 500
error. The following errors are in the log.
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.
What operating system are you using? What browser?
Server is Ubuntu 12.04, x86_64. Browser is Chrome on OS X.
Please provide any additional information below.
https://groups.google.com/d/msg/reviewboard/Ehv0JwthROg/OSMHZzucdKAJ
The following script seems to fix up the sequences.
psql -t ${DB} -c "SELECT E'select setval(\'' || c.relname || E'\', (select
max(id)+1 from ' || replace(c.relname, '_id_seq', '') || '), false);' FROM
pg_class c WHERE c.relkind = 'S';" | psql ${DB}
--
You received this message because this project is configured to send all
issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings
--
You received this message because you are subscribed to the Google Groups
"reviewboard-issues" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/reviewboard-issues?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.