Modify

Opened 14 months ago

Last modified 14 months ago

#9976 assigned defect

Internal error with Postgresql database.

Reported by: rozhi Owned by: seccanj
Priority: normal Component: FaqPlugin
Severity: normal Keywords:
Cc: Trac Release: 0.12

Description (last modified by rjollos)

Clicking on the FAQ top menu option generates an Internal Server Error.
The trac.log displays:

ProgrammingError: column "wiki.text" must appear in the GROUP BY clause or be used in an aggregate function
LINE 1: SELECT name, text, max(version) FROM wiki WHERE name LIKE 'F...

Attachments (0)

Change History (4)

comment:1 Changed 14 months ago by rozhi

The solution is to modify a SQL statement in the macros.py file to be valid with Postgresql.
Below is the new SQL statement (macros.py (line 246)):
current:

    sql = "SELECT name, text, max(version) FROM wiki WHERE name LIKE '%s%%' GROUP BY name ORDER BY name" % curpage

new:

    sql = "SELECT name, text, version FROM wiki WHERE name LIKE '%s%%' AND version = (select max(version) FROM wiki WHERE name LIKE '%s%%')" % (curpage, curpage)

comment:2 Changed 14 months ago by rjollos

  • Description modified (diff)

comment:3 Changed 14 months ago by seccanj

Rozhi,
I like when people finds problems, and I like it even more when they also find the solutions ;-)

Thanks for sharing this one.

I will try the modified version with SQLite and eventually update the code in next release asap.

BTW, if you think af anything that may improve this plugin, feel free to open an enhancement request here on trac-hacks (or provide a patch ;-)).

Ciao,
Roberto

comment:4 Changed 14 months ago by seccanj

  • Status changed from new to assigned

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as assigned .
as The resolution will be set. Next status will be 'closed'.
to The owner will be changed from seccanj. Next status will be 'new'.
Author


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

 
Note: See TracTickets for help on using tickets.