Moodle
  1. Moodle
  2. MDL-26351

Installation not possible on postgresql server with standard_conforming_strings enabled

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 2.0.1
    • Fix Version/s: 2.0.2
    • Component/s: Installation
    • Labels:
      None
    • Database:
      PostgreSQL
    • Affected Branches:
      MOODLE_20_STABLE
    • Fixed Branches:
      MOODLE_20_STABLE
    • Rank:
      16473

      Description

      Trying to install master version, postgresql database in in use. The third installation screen (database population) getting stuck with the following error:

      Debug info: ERROR: syntax error at or near "grade_updated"
      LINE 1: ...handlers. For example, the assignment registers \'grade_upda...
      ^
      COMMENT ON TABLE mdl_events_handlers IS 'This table is for storing which components requests what type of event, and the location of the responsible handlers. For example, the assignment registers \'grade_updated\' event with a function assignment_grade_handler() that should be called event t'
      Stack trace:
      
          * line 397 of /lib/dml/moodle_database.php: ddl_change_structure_exception thrown
          * line 232 of /lib/dml/pgsql_native_moodle_database.php: call to moodle_database->query_end()
          * line 573 of /lib/dml/pgsql_native_moodle_database.php: call to pgsql_native_moodle_database->query_end()
          * line 88 of /lib/ddl/database_manager.php: call to pgsql_native_moodle_database->change_database_structure()
          * line 75 of /lib/ddl/database_manager.php: call to database_manager->execute_sql()
          * line 456 of /lib/ddl/database_manager.php: call to database_manager->execute_sql_arr()
          * line 408 of /lib/ddl/database_manager.php: call to database_manager->install_from_xmldb_structure()
          * line 1321 of /lib/upgradelib.php: call to database_manager->install_from_xmldb_file()
          * line 169 of /admin/index.php: call to install_core()
      

      I believe it is related to single quotes escaping in the table/field comments.
      Thanks

        Issue Links

          Activity

          Hide
          Petr Škoda added a comment -

          Hello, the problem is that Postgresql is now using different type of quoting.

          Show
          Petr Škoda added a comment - Hello, the problem is that Postgresql is now using different type of quoting.
          Hide
          Ruslan Kabalin added a comment -

          Good to know. The above error has been encountered with version 8.3.11.

          Show
          Ruslan Kabalin added a comment - Good to know. The above error has been encountered with version 8.3.11.
          Hide
          Petr Škoda added a comment - - edited

          I am going to remove the ' from install files, that will be the easies workaround for now. The rest of the code should hopefully work fine, if not we could add a new option to the Moodle pgsql driver.

          grrrr: sorry for the noise

          Show
          Petr Škoda added a comment - - edited I am going to remove the ' from install files, that will be the easies workaround for now. The rest of the code should hopefully work fine, if not we could add a new option to the Moodle pgsql driver. grrrr: sorry for the noise
          Hide
          Ruslan Kabalin added a comment -

          > I am going to remove the ' from install files
          That sounds the most reasonable to me. Thanks Petr.

          Show
          Ruslan Kabalin added a comment - > I am going to remove the ' from install files That sounds the most reasonable to me. Thanks Petr.
          Hide
          Petr Škoda added a comment -

          Fix will be available in the next weekly build, thanks a lot for the report!

          Petr

          Show
          Petr Škoda added a comment - Fix will be available in the next weekly build, thanks a lot for the report! Petr
          Hide
          David Mudrak added a comment -

          Tested. Thanks for the report Ruslan

          Show
          David Mudrak added a comment - Tested. Thanks for the report Ruslan

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: