Upgrade 0.11-0.12 fails with PostgreSQL

Bug #708472 reported by Danny Adair
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Griffith
Fix Committed
Medium
Michael

Bug Description

Hi,

Upgrading from Ubuntu Maverick's 0.11-1
to griffith_0.12.1-1_all.deb (not waiting for Natty)
I get an error when the database is attempted to be upgraded.

It seems that the raw SQL used is understood by MySQL/MSSQL, but not by PostgreSQL (which I'm using).

dbupgrade.py:270
===================
 queries = {'created': 'ALTER TABLE movies ADD created DATETIME;',
            'updated': 'ALTER TABLE movies ADD updated DATETIME;'}
===================
"DATETIME" needs to say "TIMESTAMP" for PostgreSQL
I see self.session.bind.name was prepared in v3 but never used.
This may be a good time :-) dialect name will be 'postgres'...

As it is a one-off upgrade I just edited the file for the first run and all worked well.
Hth

Cheers,
Danny

Revision history for this message
Michael (mikej06) wrote :

Fixed in rev. 1511.
Do you have a chance to look at the fix? I don't have a PostgreSQL installation to check if it works.

Changed in griffith:
assignee: nobody → Michael (mikej06)
importance: Undecided → Medium
milestone: none → 0.13
status: New → Fix Committed
Revision history for this message
Danny Adair (danny-adair) wrote :

I think you mean revision 1396?
http://bazaar.launchpad.net/~piotr/griffith/trunk/revision/1396

Unfortunately, now that the database is upgraded it won't get upgraded again (and I don't have an old copy).

However, I quickly tested by adjusting sql.py so that dbupgrade.ugrade_database() is called even if the version is already current, and logged self.session.bind.name - turns out it is "postgresql" not "postgres". That's not what I read in sqlalchemy's docs, so maybe check self.session.bind.name in ['postgres', 'postgresql'] - maybe it varies in different versions (?).

Revision history for this message
Michael (mikej06) wrote :

changed it with rev. 1535.
the was changed with sqlalchemy 0.6 from postgres to postgresql.
bug report is realted to https://bugs.launchpad.net/bugs/716176

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.