New Version - Postgresql Compliance - Please Test!

New Version - Postgresql Compliance - Please Test!

by Mike Churchward -
Number of replies: 14
Picture of Core developers Picture of Plugin developers Picture of Testers
Okay. I have just committed a massive change to CVS. This change modifies all database calls to work with Moodle standard database calls. I have also added a 'postgres7.sql' file to (hopefully) allow the module to work with Postgresql.

THIS IS UNTESTED. PLEASE DO NOT USE ON A CRITICAL SYSTEM (yet).

I need testers to download and run this module, both on PostgreSQL and MySQL. I need to know if ther have been any bugs introduced.

Also, the 'Postgres7.sql' file that I've included was created from a Perl script I found that converts MySQL data dumps to PostgreSQL data dumps. I don't know how well it works, so there may be problems there as well. If anyone can verify and update (if necessary) this script, that would be very helpful.

I will monitor this discussion for problems / successes.

mike
Average of ratings: -
In reply to Mike Churchward

Re: New Version - Postgresql Compliance - Please Test!

by Carlos Nunes -

Great work Mike.

Can you post the link where we can download the module?

Thanks.

In reply to Carlos Nunes

Re: New Version - Postgresql Compliance - Please Test!

by Mike Churchward -
Picture of Core developers Picture of Plugin developers Picture of Testers
You can get from here, or straight from the contrib CVS directory. CVS is best, as its most current (I've already posted some corrections there).

mike
In reply to Mike Churchward

Re: New Version - Postgresql Compliance - Please Test!

by Harry Burgin -
Mike, I think there is problem with the zip file - when I log in and go to the admin page I get a message that file '.. mod/questionnaire/db/postgres7.php was unreadable'

The file seems to be missing from the zip.
In reply to Harry Burgin

Re: New Version - Postgresql Compliance - Please Test!

by Mike Churchward -
Picture of Core developers Picture of Plugin developers Picture of Testers
Harry -

Sorry. I forgot to add that file. I have added it now, but it will be a while before its in the zip file.

I've attached it here for you. Copy it to your '/mod/questionnaire/db/' directory.

mike
In reply to Mike Churchward

Re: New Version - Postgresql Compliance - Please Test!

by Carlos Nunes -
what about the "postgres7.sql" file? where can I get it?
In reply to Carlos Nunes

Re: New Version - Postgresql Compliance - Please Test!

by Mike Churchward -
Picture of Core developers Picture of Plugin developers Picture of Testers
It's already part of the new module package.

mike
In reply to Mike Churchward

Re: New Version - Postgresql Compliance - Please Test!

by Carlos Nunes -

when I log in and go to the admin page I get a message that file 'Tried to modify database, but "...moodle-1.5/mod/questionnaire/db/postgres7.sql" doesn't exist!'.

That ile isn't present in the zip file.

In reply to Carlos Nunes

Re: New Version - Postgresql Compliance - Please Test!

by Mike Churchward -
Picture of Core developers Picture of Plugin developers Picture of Testers
Carlos -

I just checked the zip file, and its definitely there... Actually, all of the required files are now there.

Are you sure you installed the right one?

mike
In reply to Mike Churchward

Re: New Version - Postgresql Compliance - Please Test!

by Carlos Nunes -

My bad.

I still had the version that was available 2 days ago.

I'll test it on the weekend.

In reply to Mike Churchward

Re: New Version - Postgresql Compliance - Please Test!

by Harry Burgin -
Thanks, Mike.

The postgres7.sql file has a few problems - guess the perl script didn't convert everything from mysql to postgresql.

Some of the problems are easy for me to fix - e.g.

# Table structure for table `prefix_questionnaire`
#

create sequence __seq ;  should read create sequence prefix_questionnaire_seq;

There are several similar errors which are pretty easy to spot.  However, there are some problems which need your input - e.g.

 create table __constraint_table  ("" varchar( 11 ) primary key)\g

This needs the 'prefix_questionnaire' fix as above but also has a problem with the "" - presumably there should be a field name here.

The full output from my attempt to set up the questionnaire database follows - I'm sure it looks a lot worse than it really is ;)

It might be easier for me to work directly with a dump of you mysql structure, before the perl script has mangled it, if you would like to send it to me.  I'm not an expert sad but have converted a couple of applications from mysql to postgresql.

Harry
----------------------------------------------------------

(postgres7): create sequence __seq  

Warning: pg_exec() query failed: ERROR: Relation '__seq' already exists in /var/www/html/w3/moodle/lib/adodb/drivers/adodb-postgres64.inc.php on line 723
-5: ERROR: Relation '__seq' already exists

Error


(postgres7): create table __constraint_table ("" varchar( 11 ) primary key)\ginsert into __constraint_table values ( 'fullname' )\ginsert into __constraint_table values ( 'anonymous' )\gCREATE TABLE `mquestionnaire` ( integer DEFAULT nextval('__seq'::text) NOT NULL, "`course`" int4 NOT NULL default '0', "`name`" varchar(255) NOT NULL default '', "`summary`" text NOT NULL, "varchar" CONSTRAINT __constraint REFERENCES __constraint_table () NOT NULL default 'unlimited', "varchar" CONSTRAINT __constraint REFERENCES __constraint_table () NOT NULL DEFAULT 'fullname', "`resp_eligible`" enum( 'all', 'students', 'teachers' ) NOT NULL DEFAULT 'all', "`opendate`" INT( 10 ) NOT NULL, "`closedate`" INT( 10 ) NOT NULL, "`sid`" int4 NOT NULL default '0', "`timemodified`" int4 NOT NULL default '0', PRIMARY KEY (`id`), "UNIQUE" (`sid`))  

Warning: pg_exec() query failed: ERROR: parser: zero-length delimited identifier at or near """" at character 35 in /var/www/html/w3/moodle/lib/adodb/drivers/adodb-postgres64.inc.php on line 723
-1: ERROR: parser: zero-length delimited identifier at or near """" at character 35

Error


(postgres7): create sequence __seq  

Warning: pg_exec() query failed: ERROR: Relation '__seq' already exists in /var/www/html/w3/moodle/lib/adodb/drivers/adodb-postgres64.inc.php on line 723
-5: ERROR: Relation '__seq' already exists

Error


(postgres7): CREATE TABLE `mquestionnaire_attempts` ( integer DEFAULT nextval('__seq'::text) NOT NULL, "`qid`" int4 NOT NULL default '0', "`userid`" int4 NOT NULL default '0', "`rid`" int4 NOT NULL default '0', "`timemodified`" int4 NOT NULL default '0', PRIMARY KEY (`id`))  

Warning: pg_exec() query failed: ERROR: parser: parse error at or near "`" at character 14 in /var/www/html/w3/moodle/lib/adodb/drivers/adodb-postgres64.inc.php on line 723
-2: ERROR: parser: parse error at or near "`" at character 14

Error


(postgres7): create sequence mquestionnaire_realm__seq  

Warning: pg_exec() query failed: ERROR: Relation 'mquestionnaire_realm__seq' already exists in /var/www/html/w3/moodle/lib/adodb/drivers/adodb-postgres64.inc.php on line 723
-5: ERROR: Relation 'mquestionnaire_realm__seq' already exists

Error


(postgres7): CREATE TABLE mquestionnaire_realm ( integer DEFAULT nextval('mquestionnaire_realm__seq'::text) NOT NULL, "name" varchar(16) NOT NULL, "title" varchar(64) NOT NULL, "changed" timestamp NOT NULL, PRIMARY KEY (`id`), "UNIQUE" (`name`)create sequence mquestionnaire_respondent__seq  

Warning: pg_exec() query failed: ERROR: parser: parse error at or near "DEFAULT" at character 45 in /var/www/html/w3/moodle/lib/adodb/drivers/adodb-postgres64.inc.php on line 723
-2: ERROR: parser: parse error at or near "DEFAULT" at character 45

Error


(postgres7): create table mquestionnaire_respondent_disabled_constraint_table ("disabled" varchar( 3 ) primary key)\ginsert into mquestionnaire_respondent_disabled_constraint_table values ( 'Y' )\ginsert into mquestionnaire_respondent_disabled_constraint_table values ( 'N' )\gCREATE TABLE mquestionnaire_respondent ( integer DEFAULT nextval('mquestionnaire_respondent__seq'::text) NOT NULL, "username" varchar(64) NOT NULL, "password" varchar(16) NOT NULL, "auth" varchar(16) NOT NULL DEFAULT 'BASIC', "realm" varchar(16) NOT NULL, "fname" varchar(16), "lname" varchar(24), "email" varchar(64), "disabled" varchar CONSTRAINT mquestionnaire_respondent_disabled_constraint REFERENCES mquestionnaire_respondent_disabled_constraint_table (disabled) NOT NULL DEFAULT 'N', "changed" timestamp NOT NULL, "expiration" timestamp, PRIMARY KEY (`id`), "UNIQUE" (username, realm)create sequence mquestionnaire_designer__seq  

Warning: pg_exec() query failed: ERROR: parser: parse error at or near "\" at character 104 in /var/www/html/w3/moodle/lib/adodb/drivers/adodb-postgres64.inc.php on line 723
-2: ERROR: parser: parse error at or near "\" at character 104

Error


(postgres7): create table mquestionnaire_designer_disabled_constraint_table ("disabled" varchar( 3 ) primary key)\ginsert into mquestionnaire_designer_disabled_constraint_table values ( 'Y' )\ginsert into mquestionnaire_designer_disabled_constraint_table values ( 'N' )\gcreate table mquestionnaire_designer_puser_constraint_table ("puser" varchar( 3 ) primary key)\ginsert into mquestionnaire_designer_puser_constraint_table values ( 'Y' )\ginsert into mquestionnaire_designer_puser_constraint_table values ( 'N' )\gcreate table mquestionnaire_designer_pstatus_constraint_table ("pstatus" varchar( 3 ) primary key)\ginsert into mquestionnaire_designer_pstatus_constraint_table values ( 'Y' )\ginsert into mquestionnaire_designer_pstatus_constraint_table values ( 'N' )\gcreate table mquestionnaire_designer_pdesign_constraint_table ("pdesign" varchar( 3 ) primary key)\ginsert into mquestionnaire_designer_pdesign_constraint_table values ( 'Y' )\ginsert into mquestionnaire_designer_pdesign_constraint_table values ( 'N' )\gcreate table mquestionnaire_designer_pall_constraint_table ("pall" varchar( 3 ) primary key)\ginsert into mquestionnaire_designer_pall_constraint_table values ( 'Y' )\ginsert into mquestionnaire_designer_pall_constraint_table values ( 'N' )\gcreate table mquestionnaire_designer_pdata_constraint_table ("pdata" varchar( 3 ) primary key)\ginsert into mquestionnaire_designer_pdata_constraint_table values ( 'Y' )\ginsert into mquestionnaire_designer_pdata_constraint_table values ( 'N' )\gcreate table mquestionnaire_designer_pgroup_constraint_table ("pgroup" varchar( 3 ) primary key)\ginsert into mquestionnaire_designer_pgroup_constraint_table values ( 'Y' )\ginsert into mquestionnaire_designer_pgroup_constraint_table values ( 'N' )\gCREATE TABLE mquestionnaire_designer ( integer DEFAULT nextval('mquestionnaire_designer__seq'::text) NOT NULL, "username" varchar(64) NOT NULL, "password" varchar(16) NOT NULL, "auth" varchar(16) NOT NULL DEFAULT 'BASIC', "realm" varchar(16) NOT NULL, "fname" varchar(16), "lname" varchar(24), "email" varchar(64), "pdesign" varchar CONSTRAINT mquestionnaire_designer_pdesign_constraint REFERENCES mquestionnaire_designer_pdesign_constraint_table (pdesign) NOT NULL DEFAULT 'Y', "pstatus" varchar CONSTRAINT mquestionnaire_designer_pstatus_constraint REFERENCES mquestionnaire_designer_pstatus_constraint_table (pstatus) NOT NULL DEFAULT 'N', "pdata" varchar CONSTRAINT mquestionnaire_designer_pdata_constraint REFERENCES mquestionnaire_designer_pdata_constraint_table (pdata) NOT NULL DEFAULT 'N', "pall" varchar CONSTRAINT mquestionnaire_designer_pall_constraint REFERENCES mquestionnaire_designer_pall_constraint_table (pall) NOT NULL DEFAULT 'N', "pgroup" varchar CONSTRAINT mquestionnaire_designer_pgroup_constraint REFERENCES mquestionnaire_designer_pgroup_constraint_table (pgroup) NOT NULL DEFAULT 'N', "puser" varchar CONSTRAINT mquestionnaire_designer_puser_constraint REFERENCES mquestionnaire_designer_puser_constraint_table (puser) NOT NULL DEFAULT 'N', "disabled" varchar CONSTRAINT mquestionnaire_designer_disabled_constraint REFERENCES mquestionnaire_designer_disabled_constraint_table (disabled) NOT NULL DEFAULT 'N', "changed" timestamp NOT NULL, "expiration" timestamp, PRIMARY KEY (`id`), "UNIQUE" (username, realm)INSERT INTO mquestionnaire_realm ( name, title ) VALUES ( 'superuser', 'ESP System Administrators' ), ( 'auto', 'Self added users' ), ( 'private', 'Moodle course surveys' ), ( 'public', 'Moodle site wide surveys' ), ( 'template', 'Moodle site wide templates' )  

Warning: pg_exec() query failed: ERROR: parser: parse error at or near "\" at character 102 in /var/www/html/w3/moodle/lib/adodb/drivers/adodb-postgres64.inc.php on line 723
-2: ERROR: parser: parse error at or near "\" at character 102

Error


(postgres7): INSERT INTO mquestionnaire_designer (username, password, fname, lname, realm, pdesign, pstatus, pdata, pall, pgroup, puser, disabled) VALUES ('root', PASSWORD('esp'), 'ESP', 'Superuser', 'superuser', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'N')  

Warning: pg_exec() query failed: ERROR: Relation "mquestionnaire_designer" does not exist in /var/www/html/w3/moodle/lib/adodb/drivers/adodb-postgres64.inc.php on line 723
-18: ERROR: Relation "mquestionnaire_designer" does not exist

Error


(postgres7): create sequence mquestionnaire_survey_id_seq  

Warning: pg_exec() query failed: ERROR: Relation 'mquestionnaire_survey_id_seq' already exists in /var/www/html/w3/moodle/lib/adodb/drivers/adodb-postgres64.inc.php on line 723
-5: ERROR: Relation 'mquestionnaire_survey_id_seq' already exists

Error


(postgres7): create table mquestionnaire_survey_public_constraint_table ("public" varchar( 3 ) primary key)\ginsert into mquestionnaire_survey_public_constraint_table values ( 'Y' )\ginsert into mquestionnaire_survey_public_constraint_table values ( 'N' )\gCREATE TABLE mquestionnaire_survey (id integer DEFAULT nextval('mquestionnaire_survey_id_seq'::text) NOT NULL, "name" varchar(64) NOT NULL, "owner" varchar(16) NOT NULL, "realm" varchar(64) NOT NULL, "public" varchar CONSTRAINT mquestionnaire_survey_public_constraint REFERENCES mquestionnaire_survey_public_constraint_table (public) NOT NULL DEFAULT 'Y', "status" INT UNSIGNED NOT NULL DEFAULT '0', "title" varchar(255) NOT NULL, "email" varchar(64), "subtitle" TEXT, "info" TEXT, "theme" varchar(64), "thanks_page" varchar(255), "thank_head" varchar(255), "thank_body" TEXT, "changed" timestamp NOT NULL, PRIMARY KEY (id), "UNIQUE" (`name`), "UNIQUE" (`owner`)create sequence mquestionnaire_question_type_id_seq  

Warning: pg_exec() query failed: ERROR: parser: parse error at or near "\" at character 96 in /var/www/html/w3/moodle/lib/adodb/drivers/adodb-postgres64.inc.php on line 723
-2: ERROR: parser: parse error at or near "\" at character 96

Error


(postgres7): create table mquestionnaire_question_type_has_choices_constraint_table ("has_choices" varchar( 3 ) primary key)\ginsert into mquestionnaire_question_type_has_choices_constraint_table values ( 'Y' )\ginsert into mquestionnaire_question_type_has_choices_constraint_table values ( 'N' )\gCREATE TABLE mquestionnaire_question_type (id integer DEFAULT nextval('mquestionnaire_question_type_id_seq'::text) NOT NULL, "type" varchar(32) NOT NULL, "has_choices" varchar CONSTRAINT mquestionnaire_question_type_has_choices_constraint REFERENCES mquestionnaire_question_type_has_choices_constraint_table (has_choices) NOT NULL, "response_table" varchar(32) NOT NULL, PRIMARY KEY (id)create sequence mquestionnaire_question_id_seq  

Warning: pg_exec() query failed: ERROR: parser: parse error at or near "\" at character 113 in /var/www/html/w3/moodle/lib/adodb/drivers/adodb-postgres64.inc.php on line 723
-2: ERROR: parser: parse error at or near "\" at character 113

Error


(postgres7): create table mquestionnaire_question_deleted_constraint_table ("deleted" varchar( 3 ) primary key)\ginsert into mquestionnaire_question_deleted_constraint_table values ( 'Y' )\ginsert into mquestionnaire_question_deleted_constraint_table values ( 'N' )\gcreate table mquestionnaire_question_public_constraint_table ("public" varchar( 3 ) primary key)\ginsert into mquestionnaire_question_public_constraint_table values ( 'Y' )\ginsert into mquestionnaire_question_public_constraint_table values ( 'N' )\gcreate table mquestionnaire_question_required_constraint_table ("required" varchar( 3 ) primary key)\ginsert into mquestionnaire_question_required_constraint_table values ( 'Y' )\ginsert into mquestionnaire_question_required_constraint_table values ( 'N' )\gCREATE TABLE mquestionnaire_question (id integer DEFAULT nextval('mquestionnaire_question_id_seq'::text) NOT NULL, "survey_id" INT UNSIGNED NOT NULL, "name" varchar(30) NOT NULL, "type_id" INT UNSIGNED NOT NULL, "result_id" INT UNSIGNED, "length" INT NOT NULL DEFAULT 0, "precise" INT NOT NULL DEFAULT 0, "position" INT UNSIGNED NOT NULL, "content" TEXT NOT NULL, "required" varchar CONSTRAINT mquestionnaire_question_required_constraint REFERENCES mquestionnaire_question_required_constraint_table (required) NOT NULL DEFAULT 'N', "deleted" varchar CONSTRAINT mquestionnaire_question_deleted_constraint REFERENCES mquestionnaire_question_deleted_constraint_table (deleted) NOT NULL DEFAULT 'N', "public" varchar CONSTRAINT mquestionnaire_question_public_constraint REFERENCES mquestionnaire_question_public_constraint_table (public) NOT NULL DEFAULT 'Y', PRIMARY KEY (id)create sequence mquestionnaire_question_choice_id_seq  

Warning: pg_exec() query failed: ERROR: parser: parse error at or near "\" at character 100 in /var/www/html/w3/moodle/lib/adodb/drivers/adodb-postgres64.inc.php on line 723
-2: ERROR: parser: parse error at or near "\" at character 100

Error


(postgres7): CREATE TABLE mquestionnaire_question_choice (id integer DEFAULT nextval('mquestionnaire_question_choice_id_seq'::text) NOT NULL, "question_id" INT UNSIGNED NOT NULL, "content" TEXT NOT NULL, "value" TEXT, PRIMARY KEY (id)create sequence mquestionnaire_access_id_seq  

Warning: pg_exec() query failed: ERROR: parser: parse error at or near "UNSIGNED" at character 148 in /var/www/html/w3/moodle/lib/adodb/drivers/adodb-postgres64.inc.php on line 723
-2: ERROR: parser: parse error at or near "UNSIGNED" at character 148

Error


(postgres7): create table mquestionnaire_access_resume_constraint_table ("resume" varchar( 3 ) primary key)\ginsert into mquestionnaire_access_resume_constraint_table values ( 'Y' )\ginsert into mquestionnaire_access_resume_constraint_table values ( 'N' )\gcreate table mquestionnaire_access_navigate_constraint_table ("navigate" varchar( 3 ) primary key)\ginsert into mquestionnaire_access_navigate_constraint_table values ( 'Y' )\ginsert into mquestionnaire_access_navigate_constraint_table values ( 'N' )\gCREATE TABLE mquestionnaire_access (id integer DEFAULT nextval('mquestionnaire_access_id_seq'::text) NOT NULL, "survey_id" INT UNSIGNED NOT NULL, "realm" varchar(16), "maxlogin" INT UNSIGNED DEFAULT '0', "resume" varchar CONSTRAINT mquestionnaire_access_resume_constraint REFERENCES mquestionnaire_access_resume_constraint_table (resume) NOT NULL DEFAULT 'N', "navigate" varchar CONSTRAINT mquestionnaire_access_navigate_constraint REFERENCES mquestionnaire_access_navigate_constraint_table (navigate) NOT NULL DEFAULT 'N', PRIMARY KEY(id)create sequence mquestionnaire_response_id_seq  

Warning: pg_exec() query failed: ERROR: parser: parse error at or near "\" at character 96 in /var/www/html/w3/moodle/lib/adodb/drivers/adodb-postgres64.inc.php on line 723
-2: ERROR: parser: parse error at or near "\" at character 96

Error


(postgres7): create table mquestionnaire_response_complete_constraint_table ("complete" varchar( 3 ) primary key)\ginsert into mquestionnaire_response_complete_constraint_table values ( 'Y' )\ginsert into mquestionnaire_response_complete_constraint_table values ( 'N' )\gCREATE TABLE mquestionnaire_response (id integer DEFAULT nextval('mquestionnaire_response_id_seq'::text) NOT NULL, "survey_id" INT UNSIGNED NOT NULL, "submitted" timestamp NOT NULL, "complete" varchar CONSTRAINT mquestionnaire_response_complete_constraint REFERENCES mquestionnaire_response_complete_constraint_table (complete) NOT NULL DEFAULT 'N', "username" varchar(64), PRIMARY KEY (id)create sequence mquestionnaire_response_bool__seq  

Warning: pg_exec() query failed: ERROR: parser: parse error at or near "\" at character 102 in /var/www/html/w3/moodle/lib/adodb/drivers/adodb-postgres64.inc.php on line 723
-2: ERROR: parser: parse error at or near "\" at character 102

Error


(postgres7): create table mquestionnaire_response_bool_choice_id_constraint_table ("choice_id" varchar( 3 ) primary key)\ginsert into mquestionnaire_response_bool_choice_id_constraint_table values ( 'Y' )\ginsert into mquestionnaire_response_bool_choice_id_constraint_table values ( 'N' )\gCREATE TABLE mquestionnaire_response_bool ( integer DEFAULT nextval('mquestionnaire_response_bool__seq'::text) NOT NULL, "response_id" INT UNSIGNED NOT NULL, "question_id" INT UNSIGNED NOT NULL, "choice_id" varchar CONSTRAINT mquestionnaire_response_bool_choice_id_constraint REFERENCES mquestionnaire_response_bool_choice_id_constraint_table (choice_id) NOT NULL, PRIMARY KEY (id), "UNIQUE" (response_id, question_id)create sequence mquestionnaire_response_single__seq  

Warning: pg_exec() query failed: ERROR: parser: parse error at or near "\" at character 109 in /var/www/html/w3/moodle/lib/adodb/drivers/adodb-postgres64.inc.php on line 723
-2: ERROR: parser: parse error at or near "\" at character 109

Error


(postgres7): CREATE TABLE mquestionnaire_response_single ( integer DEFAULT nextval('mquestionnaire_response_single__seq'::text) NOT NULL, "response_id" INT UNSIGNED NOT NULL, "question_id" INT UNSIGNED NOT NULL, "choice_id" INT UNSIGNED NOT NULL, PRIMARY KEY (id), "UNIQUE" (response_id, question_id)create sequence mquestionnaire_response_multiple_id_seq  

Warning: pg_exec() query failed: ERROR: parser: parse error at or near "DEFAULT" at character 55 in /var/www/html/w3/moodle/lib/adodb/drivers/adodb-postgres64.inc.php on line 723
-2: ERROR: parser: parse error at or near "DEFAULT" at character 55

Error


(postgres7): CREATE TABLE mquestionnaire_response_multiple (id integer DEFAULT nextval('mquestionnaire_response_multiple_id_seq'::text) NOT NULL, "response_id" INT UNSIGNED NOT NULL, "question_id" INT UNSIGNED NOT NULL, "choice_id" INT UNSIGNED NOT NULL, PRIMARY KEY(id)create sequence mquestionnaire_response_rank__seq  

Warning: pg_exec() query failed: ERROR: parser: parse error at or near "UNSIGNED" at character 152 in /var/www/html/w3/moodle/lib/adodb/drivers/adodb-postgres64.inc.php on line 723
-2: ERROR: parser: parse error at or near "UNSIGNED" at character 152

Error


(postgres7): CREATE TABLE mquestionnaire_response_rank ( integer DEFAULT nextval('mquestionnaire_response_rank__seq'::text) NOT NULL, "response_id" INT UNSIGNED NOT NULL, "question_id" INT UNSIGNED NOT NULL, "choice_id" INT UNSIGNED NOT NULL, "rank" INT NOT NULL, PRIMARY KEY (id), "UNIQUE" (response_id, question_id, choice_id)create sequence mquestionnaire_response_text__seq  

Warning: pg_exec() query failed: ERROR: parser: parse error at or near "DEFAULT" at character 53 in /var/www/html/w3/moodle/lib/adodb/drivers/adodb-postgres64.inc.php on line 723
-2: ERROR: parser: parse error at or near "DEFAULT" at character 53

Error


(postgres7): CREATE TABLE mquestionnaire_response_text ( integer DEFAULT nextval('mquestionnaire_response_text__seq'::text) NOT NULL, "response_id" INT UNSIGNED NOT NULL, "question_id" INT UNSIGNED NOT NULL, "response" TEXT, PRIMARY KEY (id), "UNIQUE" (response_id, question_id)create sequence mquestionnaire_response_other__seq  

Warning: pg_exec() query failed: ERROR: parser: parse error at or near "DEFAULT" at character 53 in /var/www/html/w3/moodle/lib/adodb/drivers/adodb-postgres64.inc.php on line 723
-2: ERROR: parser: parse error at or near "DEFAULT" at character 53

Error


(postgres7): CREATE TABLE mquestionnaire_response_other ( integer DEFAULT nextval('mquestionnaire_response_other__seq'::text) NOT NULL, "response_id" INT UNSIGNED NOT NULL, "question_id" INT UNSIGNED NOT NULL, "choice_id" INT UNSIGNED NOT NULL, "response" TEXT, PRIMARY KEY (id), "UNIQUE" (response_id, question_id, choice_id)create sequence mquestionnaire_response_date__seq  

Warning: pg_exec() query failed: ERROR: parser: parse error at or near "DEFAULT" at character 54 in /var/www/html/w3/moodle/lib/adodb/drivers/adodb-postgres64.inc.php on line 723
-2: ERROR: parser: parse error at or near "DEFAULT" at character 54

Error


(postgres7): CREATE TABLE mquestionnaire_response_date ( integer DEFAULT nextval('mquestionnaire_response_date__seq'::text) NOT NULL, "response_id" INT UNSIGNED NOT NULL, "question_id" INT UNSIGNED NOT NULL, "response" DATE, PRIMARY KEY (id), "UNIQUE" (response_id, question_id)INSERT INTO mquestionnaire_question_type VALUES ('1', 'Yes/No', 'N', 'response_bool')  

Warning: pg_exec() query failed: ERROR: parser: parse error at or near "DEFAULT" at character 53 in /var/www/html/w3/moodle/lib/adodb/drivers/adodb-postgres64.inc.php on line 723
-2: ERROR: parser: parse error at or near "DEFAULT" at character 53

Error


(postgres7): INSERT INTO mquestionnaire_question_type VALUES ('2', 'Text Box', 'N', 'response_text')  

Warning: pg_exec() query failed: ERROR: Relation "mquestionnaire_question_type" does not exist in /var/www/html/w3/moodle/lib/adodb/drivers/adodb-postgres64.inc.php on line 723
-18: ERROR: Relation "mquestionnaire_question_type" does not exist

Error


(postgres7): INSERT INTO mquestionnaire_question_type VALUES ('3', 'Essay Box', 'N', 'response_text')  

Warning: pg_exec() query failed: ERROR: Relation "mquestionnaire_question_type" does not exist in /var/www/html/w3/moodle/lib/adodb/drivers/adodb-postgres64.inc.php on line 723
-18: ERROR: Relation "mquestionnaire_question_type" does not exist

Error


(postgres7): INSERT INTO mquestionnaire_question_type VALUES ('4', 'Radio Buttons', 'Y', 'response_single')  

Warning: pg_exec() query failed: ERROR: Relation "mquestionnaire_question_type" does not exist in /var/www/html/w3/moodle/lib/adodb/drivers/adodb-postgres64.inc.php on line 723
-18: ERROR: Relation "mquestionnaire_question_type" does not exist

Error


(postgres7): INSERT INTO mquestionnaire_question_type VALUES ('5', 'Check Boxes', 'Y', 'response_multiple')  

Warning: pg_exec() query failed: ERROR: Relation "mquestionnaire_question_type" does not exist in /var/www/html/w3/moodle/lib/adodb/drivers/adodb-postgres64.inc.php on line 723
-18: ERROR: Relation "mquestionnaire_question_type" does not exist

Error


(postgres7): INSERT INTO mquestionnaire_question_type VALUES ('6', 'Dropdown Box', 'Y', 'response_single')  

Warning: pg_exec() query failed: ERROR: Relation "mquestionnaire_question_type" does not exist in /var/www/html/w3/moodle/lib/adodb/drivers/adodb-postgres64.inc.php on line 723
-18: ERROR: Relation "mquestionnaire_question_type" does not exist

Error


(postgres7): INSERT INTO mquestionnaire_question_type VALUES ('8', 'Rate (scale 1..5)', 'Y', 'response_rank')  

Warning: pg_exec() query failed: ERROR: Relation "mquestionnaire_question_type" does not exist in /var/www/html/w3/moodle/lib/adodb/drivers/adodb-postgres64.inc.php on line 723
-18: ERROR: Relation "mquestionnaire_question_type" does not exist

Error


(postgres7): INSERT INTO mquestionnaire_question_type VALUES ('9', 'Date', 'N', 'response_date')  

Warning: pg_exec() query failed: ERROR: Relation "mquestionnaire_question_type" does not exist in /var/www/html/w3/moodle/lib/adodb/drivers/adodb-postgres64.inc.php on line 723
-18: ERROR: Relation "mquestionnaire_question_type" does not exist

Error


(postgres7): INSERT INTO mquestionnaire_question_type VALUES ('10', 'Numeric', 'N', 'response_text')  

Warning: pg_exec() query failed: ERROR: Relation "mquestionnaire_question_type" does not exist in /var/www/html/w3/moodle/lib/adodb/drivers/adodb-postgres64.inc.php on line 723
-18: ERROR: Relation "mquestionnaire_question_type" does not exist

Error


(postgres7): INSERT INTO mquestionnaire_question_type VALUES ('99', 'Page Break', 'N', '')  

Warning: pg_exec() query failed: ERROR: Relation "mquestionnaire_question_type" does not exist in /var/www/html/w3/moodle/lib/adodb/drivers/adodb-postgres64.inc.php on line 723
-18: ERROR: Relation "mquestionnaire_question_type" does not exist

Error


(postgres7): INSERT INTO mquestionnaire_question_type VALUES ('100', 'Section Text', 'N', '')  

Warning: pg_exec() query failed: ERROR: Relation "mquestionnaire_question_type" does not exist in /var/www/html/w3/moodle/lib/adodb/drivers/adodb-postgres64.inc.php on line 723
-18: ERROR: Relation "mquestionnaire_question_type" does not exist

Error

 
 

(postgres7): SELECT COUNT(*) FROM mmessage WHERE useridto = '2' AND timecreated > '0'  

questionnaire tables could NOT be set up successfully!
In reply to Harry Burgin

Re: New Version - Postgresql Compliance - Please Test!

by Mike Churchward -
Picture of Core developers Picture of Plugin developers Picture of Testers
Harry -

Looks like a lot of errors. I guess that auto convert script wasn't worth much.

If you can do the conversion, that would be great. The MySQL file is in the same directory as the PostgreSQL file - its called 'mysql.sql'.

mike
In reply to Mike Churchward

Re: New Version - Postgresql Compliance - Please Test!

by Mike Churchward -
Picture of Core developers Picture of Plugin developers Picture of Testers
Okay.

Just committed another large update to CVS, fixing a lot of problems we had getting PostgreSQL to work with this module. With the help of Harry Burgin, who was kind enough to use his system as a guinea pig, I believe we have a working module. At least, it now seems to work on both my MySQL system and his PostgreSQL system. It should be available in a zip archive from the CVS area in another 24 hours or so.

If you have this installed on a Postgres system currently, please remove the module from your system using your 'admin/config/module' function and re-install it. The data tables for the questionnaire need to be rebuilt under PostgreSQL.

A number of issues were fixed over the last release, most importantly the Postgres7.sql file. The 'CHAR' values have been changed to 'VARCHAR' to correct for the extra padding Postgres adds with the fixed length 'CHAR' field.

Also, some issues that were cropping up in either MySQL or PostgreSQL hopefully have been fixed. These appear to have been caused by the use of 'HTTP_' variables in phpESP, and scope issues.

Please let me know if there are new problems.

mike
In reply to Mike Churchward

Installing the new questionnaire

by Nikki Macfarlane -
Great work! I would love to install and try it out but the instructions are just a little beyond my very very meagre programming abilities.

I have looked at CVS/contrib and can see a questionnaire folder there witha  load of files in it. But cannot see the zip file. I am obviously not looking in the right place - can someone guide me here?

Also, Mike's instructions about if you are using on a Postgres system that you need to reinstall - how can I tell if I am on postgres or postgressql? You can see I am a very very basic programmer!

Thanks.
In reply to Nikki Macfarlane

Re: Installing the new questionnaire

by Mike Churchward -
Picture of Core developers Picture of Plugin developers Picture of Testers
Hi -

You can always get the latest zip here: http://download.moodle.org/modules/.

You will either be using PostgreSQL or MySQL - this depends on your hosting environment. If you've never installed the module, you don't need to worry about re-installing it.

mike