Comments (1)
On 16-Apr-2010, at 11:21am, scott wrote (Trac issue 1504#comment:1):
I ran into this as well.
The problem is that currval of a sequence id is a a session-local value. It cannot be retrieved unless nextval has been called for the current session.
I fixed this by modifying:
/usr/lib/python2.6/dist-packages/trac/db/postgres_backend.py
to call setval, max(id) first to update the sequence value for the session
+++ /usr/lib/python2.6/dist-packages/trac/db/postgres_backend.py
@@ -215,5 +215,6 @@
return _like_escape_re.sub(r'/\1', text)
def get_last_id(self, cursor, table, column='id'):
+ cursor.execute("SELECT SETVAL('%s_%s_seq', max(%s)) FROM %s" % (table, column,column,table))
cursor.execute("SELECT CURRVAL('%s_%s_seq')" % (table, column))
return cursor.fetchone()[0]
from mantis2trac.
Related Issues (8)
- import one project HOT 1
- Any interest in adding your plugin to the trac-hacks organization? HOT 9
- mantis2trac.py dies on Unicode errors HOT 3
- multiple errors on running mantis2trac.py with Mantis 1.0.1 and Trac 0.10 HOT 19
- mantis bugs that change reporter break addTicketChange()
- url change in mantis issue history breaks addTicketChange()
- UnicodeDecodeError HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mantis2trac.