Ticket #470 (closed defect: fixed)

Opened 3 years ago

Last modified 3 years ago

Database upgrade fails on PostgreSQL

Reported by: hrvelic@inet.hr Assigned to: Blackhex
Priority: normal Component: DiscussionPlugin
Severity: blocker Keywords:
Cc: Trac Release: 0.9

Description (Last modified by coderanger)

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

Change History

06/29/06 07:39:30 changed by hrvelic@inet.hr

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

06/30/06 14:29:36 changed by kauberry

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

06/30/06 14:38:04 changed by coderanger

  • description changed.

Fix formatting in the description

07/01/06 12:54:56 changed by Blackhex

  • status changed from new to closed.
  • resolution set to fixed.

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

07/02/06 02:28:43 changed by kauberry

  • status changed from closed to reopened.
  • resolution deleted.

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

07/02/06 13:02:52 changed by Blackhex

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.

07/02/06 19:19:17 changed by hrvelic@inet.hr

  • status changed from reopened to closed.
  • resolution set to fixed.

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. :)


Add/Change #470 (Database upgrade fails on PostgreSQL)




Change Properties
Action