#846 closed defect (fixed)
Postgres not working
| Reported by: | anonymous | Owned by: | Sam Bloomquist |
|---|---|---|---|
| Priority: | normal | Component: | ScrumBurndownPlugin |
| Severity: | critical | Keywords: | |
| Cc: | nick.stone@… | Trac Release: | 0.9 |
Description
The plug in doesn't work with postgres. The first error is at line 42 as this is clearly written for sqlite. The line is:
cursor.execute("SELECT name FROM sqlite_master WHERE type='table' AND name='burndown'")
Can you look into fixing that as we'd love to use the plugin otherwise
Attachments (0)
Change History (8)
comment:1 Changed 19 years ago by
comment:3 Changed 19 years ago by
| Resolution: | → fixed |
|---|---|
| Status: | new → closed |
comment:4 Changed 19 years ago by
Thanks for the tip, coderanger. That was easy enough. Sorry it took me so long to get to this. I haven't tested this with postgres, but it didn't break anything for sqlite. Please re-open this ticket if the fix didn't work.
For those who care, here is what the new code looks like:
# See if the burndown table exists, if not, return True because we need to upgrade the database
cursor = db.cursor()
try:
cursor.execute('SELECT * FROM %s LIMIT 1', 'burndown')
except:
needsUpgrade = True
comment:5 Changed 19 years ago by
Thanks for the fix - I'll have a play and let you know if there's any problems
comment:6 Changed 19 years ago by
Note the fix for this ticket has been included in the following egg version (which is now available on from the ScrumBurndownPlugin wiki page:
TracBurndown-01.03.10-py2.3.egg
comment:7 follow-up: 8 Changed 19 years ago by
Is this what you meant:
cursor.execute('SELECT * FROM %s LIMIT 1' % 'burndown')
(Note '%' instead of comma ',' near burndown)
Chris
comment:8 Changed 19 years ago by
Replying to anonymous:
Is this what you meant:
cursor.execute('SELECT * FROM %s LIMIT 1' % 'burndown')
(Note '%' instead of comma ',' near burndown)
Chris
Either syntax should work. I went with the comma for consistency's sake.



Ah, yes. I forgot about postgres. The only problem is that I only learned enough about the inner workings of Trac to get this plugin up and working for my own team. If someone else could point me toward the proper (database-independent) way to do this in Trac, I'd be happy to make the change.