Modify

Opened 11 years ago

Closed 11 years ago

#470 closed defect (fixed)

Database upgrade fails on PostgreSQL

Reported by: hrvelic@… Owned by: Radek Bartoň
Priority: normal Component: DiscussionPlugin
Severity: blocker Keywords:
Cc: Trac Release: 0.9

Description (last modified by Noah Kantrowitz)

Hello. I have done the following:

  1. Downloaded and unzipped the plugin from it's homepage on trac-hacks file name is discussionplugin-r967.zip
  2. I have built the egg using python setup.py bdist_egg and installed it with easy_install --always-unzip options.
  3. I have added the following lines to the global trac.ini:
    [components]
    tracdiscussion.* = enabled
    
    [discussion]
    title = Discussion
    
  4. I have tried upgrading the environment with:

trac-admin /path/to/env upgrade --no-backup Unfortunately, it ended up with an error:

Command failed: ERROR:  column "discussion_version" does not exist

INSERT INTO system VALUES ("discussion_version", 1);

I'm using the following:

  • Ubuntu 6.06 Dapper Drake
  • Apache 2.0.xx
  • mod_python
  • Python 2.4
  • Trac 0.9.5
  • PostgreSQL 8.1

Thanks, Hrvoje Velic

Attachments (0)

Change History (7)

comment:1 Changed 11 years ago by hrvelic@…

Sorry for the mess in original post. Forgot to use Wiki Formatting...
A much better formatted version follows:
1) Downloaded and unzipped the plugin from it's homepage on trac-hacks file name is: discussionplugin-r967.zip
2) I have built the egg using python setup.py bdist_egg and installed it with easy_install —always-unzip options.
3) I have added the following lines to the global trac.ini:

[components]
tracdiscussion.* = enabled

[discussion]
title = Discussion

4) I have tried upgrading the environment with:

trac-admin /path/to/env upgrade —no-backup

Unfortunately, it ended up with an error:

Command failed: ERROR: column "discussion_version" does not exist

INSERT INTO system VALUES ("discussion_version", 1);

I'm using the following:

  • Ubuntu 6.06 Dapper Drake
  • Apache 2.0.xx
  • mod_python
  • Python 2.4
  • Trac 0.9.5
  • PostgreSQL 8.1

Thanks,
Hrvoje Velic

comment:2 Changed 11 years ago by Ken Auberry

First of all, thanks for your work on this. This plugin looks like a good value add for Trac.

However, I'm also having the same type of issues with an upgrade error using PostgreSQL with the following setup

  • Redhat Enterprise Linux AW4
  • Apache 2.2.x
  • mod_python
  • Python 2.4
  • Trac 0.10 dev (r3345)
  • PostgreSQL 8.1

Just another data point.

Thanks, Ken Auberry

comment:3 Changed 11 years ago by Noah Kantrowitz

Description: modified (diff)

Fix formatting in the description

comment:4 Changed 11 years ago by Radek Bartoň

Resolution: fixed
Status: newclosed

Changeset 976 should fix problem with incomplete INSERT statement. If it doesn't please reopen with apropriate log outputs.

comment:5 Changed 11 years ago by Ken Auberry

Resolution: fixed
Status: closedreopened

After examining the code and tinkering in the database schema locally, I found that changing the double quotes (") around the INSERT statement in tracdiscussion/db/db1.py to single quotes (') would allow the upgrade to proceed unhindered. See below.

INSERT INTO system (name, value) VALUES ('discussion_version', 1)

instead of

INSERT INTO system (name, value) VALUES ("discussion_version", 1)

similarly for the UPDATE statement in db2.py...

UPDATE system SET value = 2 WHERE name='discussion_version'
{{{
instead of
UPDATE system SET value = "2" WHERE name="discussion_version"
}}}

Hope this helps,
Ken Auberry

comment:6 Changed 11 years ago by Radek Bartoň

I've changed all sql statement in changeset 981. I haven't PostgreSQL installed so it is not tested yet. Please let me know if it works, thank you.

comment:7 Changed 11 years ago by hrvelic@…

Resolution: fixed
Status: reopenedclosed

Upgrading DB now works.
And I've already modified all the statements by hand. It was the problem of double quotes instead of single quotes. I've checkedout the latest version from subversion too and replaced my modified one. Unfortunately, I get errors when trying to create a forum. I'll post another ticket for that with the details. Thank you for your time and effort. :)

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Radek Bartoň.
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.