View Full Version : Trouble with Quercus, Moodle, and PostgreSQL

12-22-2009, 12:17 AM
I am using Moodle 1.9.7, Quercus 4.0.2, PostgreSQL 7.4, and GlassFish 3.0. When I take a quiz in Moodle, there are SQL related issues that cause Moodle to fail. When I run the same with PHP Java Bridge instead of Quercus, all is well--which is why I am posting here :-)

I started logging the PHP queries that are the proximate causes for the error messages, and indeed they give me errors when I issue them directly in PSQL. But they are caused by the fact that some records have been inserted more than once with the same ID. The Moodle code is rather messy, so I thought I'd ask for any hints first before digging deeper into it.

What level of compatibility should I expect with respect to PHP and PostgreSQL? How can I most effectively debug this?



12-22-2009, 05:12 PM
Is the SQL that Quercus producing correct?

In other words, the problem may be something not directly Postgress related. I can file a bug for this. For bug reports, it's enormously helpful to know the low-level PHP failure (like a specific function or PHP language). With just a general bug report for Moodle, it takes us a good deal of time tracking down the Moodle code to find the actual bug.

12-24-2009, 01:25 PM
There is a place where Quercus produces SQL in a way that is different than when I run Moodle with the PHP/Java bridge. I just haven't figured out how to isolate it. It inserts a record with an ID and otherwise blank information into a table, then inserts another record with the same ID and the required information. That causes a constraint violation error. Unfortunately, this being PHP, there is a Moodle database layer on top of a database layer from a third party, both of which make ad-hoc decisions based on the database type. It seems a bit daunting for me to trace all that code.

It is in the quiz functionality, which surely any Moodle user would run into, so I am wondering whether anyone else is successful running Moodle+PostgreSQL on Quercus.