Opened 15 years ago

Closed 13 years ago

#5608 closed defect (fixed)

trac-admin upgrade with PostgreSQL fails due, some specific SQL syntax required

Reported by: anonymous Owned by: Steffen Hoffmann
Priority: normal Component: TracFormsPlugin
Severity: blocker Keywords: PostgreSQL compatibility
Cc: dicianno@…, Peter Trac Release: 0.11


I'm forced to do a --no-backup upgrade during the installation, since we don't use SQLite (we use PostgreSQL).

The install then fails thusly:

dev trac # trac-admin ./SV upgrade --no-backup
Traceback (most recent call last):
  File "/usr/bin/trac-admin", line 8, in <module>
    load_entry_point('Trac==0.11.2', 'console_scripts', 'trac-admin')()
  File "//usr/lib/python2.5/site-packages/trac/admin/", line 1294, in run
    return admin.onecmd(command)
  File "//usr/lib/python2.5/site-packages/trac/admin/", line 123, in onecmd
    rv = cmd.Cmd.onecmd(self, line) or 0
  File "/usr/lib/python2.5/", line 219, in onecmd
    return func(arg)
  File "//usr/lib/python2.5/site-packages/trac/admin/", line 1144, in do_upgrade
  File "//usr/lib/python2.5/site-packages/trac/", line 449, in upgrade
  File "build/bdist.linux-i686/egg/tracforms/", line 137, in upgrade_environment
  File "build/bdist.linux-i686/egg/tracforms/", line 208, in dbschema_2008_06_15_0000
  File "build/bdist.linux-i686/egg/tracforms/", line 87, in __call__
  File "build/bdist.linux-i686/egg/tracforms/", line 42, in execute
psycopg2.ProgrammingError: syntax error at or near "AUTOINCREMENT"
LINE 3: ...              tracform_id     INTEGER PRIMARY KEY AUTOINCREM...

I tried download zip's of 0.2 and 0.3.

Setting severity to 'blocker' since the plugin is completely uninstallable at this point.

Attachments (0)

Change History (12)

comment:1 Changed 15 years ago by dicianno@…

Cc: dicianno@… added; anonymous removed

Ack -- not trying to be anonymous!

comment:2 Changed 14 years ago by Peter

Cc: Peter added

Apparently this happens because Postgres does not support (MySQL-specific) AUTOINCREMENT keyword. Yikes!

comment:3 Changed 13 years ago by Ryan J Ollos

See #5667.

comment:4 Changed 13 years ago by Ryan J Ollos

Summary: trace-admin APP upgrade --no-backup failstrac-admin upgrade with PostgreSQL

comment:5 Changed 13 years ago by Steffen Hoffmann

Keywords: PostgreSQL compatibility added
Owner: changed from Rich Harkins to Steffen Hoffmann

comment:6 Changed 13 years ago by Steffen Hoffmann

Summary: trac-admin upgrade with PostgreSQLtrac-admin upgrade with PostgreSQL fails due, some specific SQL syntax required

comment:7 Changed 13 years ago by Steffen Hoffmann

Anyone able and willing to test the recommended changes?

Your feedback would significantly speedup resolving this issue. Thanks in advance.

comment:8 Changed 13 years ago by Adrian Fritz

Will test them.

comment:9 Changed 13 years ago by Adrian Fritz

Asked to and tested by Nelso (from Boreste). Reported at

comment:10 Changed 13 years ago by Steffen Hoffmann

Status: newassigned

Thanks for forwarding my request. Seems like we're making good progress now. I rejoice when joining with interested developers and users that share ideas, pushing code to the next level.

comment:11 Changed 13 years ago by Steffen Hoffmann

(In [10168]) TracFormsPlugin: Add compatibility SQL statements for PostgreSQL, refs #5608 and #5667.

This has been developed from a of tracforms-0.2 modified by

  1. Noack, further testing done by Nelso. Thanks for your contribution.

Despite remarkable progress this is only nearly working. After some hours of try-n-error I decided to not follow this path any longer. As a matter of fact the whole db code of this plugin is broken by design. I've already straightened it a bit, but the custom db cursor implementation seems evil. Reinventing connection wrapper code by own compatibility was never smart and is bound to be finally brocken after upcoming switch from env.get_db_cnx to the new with_transaction, that has much more intelligent transaction handling in general.

comment:12 Changed 13 years ago by Steffen Hoffmann

Resolution: fixed
Status: assignedclosed

(In [10216]) TracFormsPlugin: Releasing version 0.4, pushing development to 0.5, closes #5318, #5608, #5667.

Codename 'Nelso'. ;-) This is the first release supporting PostgreSQL for storing forms data, effectively working equally well with all db backends, that are currently supported by Trac itself. Another big step towards a stable plugin. Thanks to all the kind people, who helped with their contributions in many ways. It was another rewarding experience to find the kinks and iron them out. Now everybody enjoy the new Trac power under the hood.

Modify Ticket

Change Properties
Set your email in Preferences
as closed The owner will remain Steffen Hoffmann.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment

E-mail address and name can be saved in the Preferences.

Note: See TracTickets for help on using tickets.