using questionaires with PostgreSQL?

using questionaires with PostgreSQL?

by Jelle Boomstra -
Number of replies: 3
Hi forum,
Is there a quick way to use the questionaires module on a postgres database?
I tried to install the module but ran into errors wink
first the admin page complained that postgres7.php was not readable.
I tried to fix that by copying mysql.php to postgres7.php and mysql.sql to postgres7.sql.
This did more ore les what i expected it to do, including choking on the mysql syntax :o

Did anybody try something similar and is there a way out, or do i have to code myself out of this tight spot? (problem is my sql-knowledge is pretty thin and rusty, I am used to Progres4GL).
Right now it appears to choke on some quotes, so maybe it is not too hard to fix.
Average of ratings: -
In reply to Jelle Boomstra

Re: using questionaires with PostgreSQL?

by Mike Churchward -
Picture of Core developers Picture of Plugin developers Picture of Testers
  I haven't ported the questionnaire module to Postgres yet.
In reply to Mike Churchward

Re: using questionaires with PostgreSQL?

by Jelle Boomstra -
well, I see. I am working on it right now. There are some strange things in the table setup wrt choice of datatypes, but most of these I have converted.
I guess right now I have to get rid of the previously created tables, so the sql script can properly create them and tell moodle this module initiated correctly. What happens in the actual code that is MySQL specific is the next bridge to cross, but as phpesp claims to work (somewhat) on postgresql i hvae enough hopes for that.

I'll post any progres here and I will send any modifications directly to you, Mike (if I can find your email somewhere here).
What are the plans of tightly intergrating This software into moodle?
In reply to Jelle Boomstra

Re: using questionaires with PostgreSQL?

by Jelle Boomstra -
ok that was not a very big bridge/river to cross.
I got the module to create the desired tables, now it shows up in Administration » Configuration » Modules.
Basically I copied the mysql sql statements, ripped out the size parameters for integers, changed auto-increment to pseudo type serial, changed various inserts so they conformed to the table constraints and removed those `backticks`.

As this is the first port to PostgreSQL, i don't think the db/postgres7.php file makes much sense. It looks like it is supposed to handle upgrades, but with no prior installs of this module on postgresql that would be not necessary i think.

I have yet to test the module how it actually works or shows any bugs. i changed some filetypes, so i could be in for some nice creepy crawlies wink

On a sidenote: 18 tables to implement a questionaire? Isn't that a bit much? I am not planning to rewrite this module, but I certainly would not have come up with such a setup.