Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-67220

Moodle does not support PostgreSQL 12

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Duplicate
    • 3.6.7, 3.7.3
    • None
    • Database SQL/XMLDB
    • MOODLE_36_STABLE, MOODLE_37_STABLE

    Description

      We state on our release notes that we support the latest version of PostgreSQL.

      PostgreSQL 12 is now out but Moodle installation breaks because of the obsolete column "pg_attrdef.adsrc" has been removed in PostgreSQL 12.

      Below is the error that I encountered when I tried installing Moodle using PostgreSQL 12:

      Debug info: ERROR: column d.adsrc does not exist
      LINE 1: ...e, a.attlen, a.atttypmod, a.attnotnull, a.atthasdef, d.adsrc
      ^
      SELECT a.attnum, a.attname AS field, t.typname AS type, a.attlen, a.atttypmod, a.attnotnull, a.atthasdef, d.adsrc
      FROM pg_catalog.pg_class c
      JOIN pg_catalog.pg_namespace as ns ON ns.oid = c.relnamespace
      JOIN pg_catalog.pg_attribute a ON a.attrelid = c.oid
      JOIN pg_catalog.pg_type t ON t.oid = a.atttypid
      LEFT JOIN pg_catalog.pg_attrdef d ON (d.adrelid = c.oid AND d.adnum = a.attnum)
      WHERE relkind = 'r' AND c.relname = 'mdl_config' AND c.reltype > 0 AND a.attnum > 0
      AND (ns.nspname = current_schema() OR ns.oid = pg_my_temp_schema())
      ORDER BY a.attnum
      [NULL] 
      Error code: dmlreadexception 
      ×
      Stack trace: 
      line 486 of \lib\dml\moodle_database.php: dml_read_exception thrown
      line 259 of \lib\dml\pgsql_native_moodle_database.php: call to moodle_database->query_end()
      line 425 of \lib\dml\pgsql_native_moodle_database.php: call to pgsql_native_moodle_database->query_end()
      line 1004 of \lib\dml\pgsql_native_moodle_database.php: call to pgsql_native_moodle_database->get_columns()
      line 1406 of \lib\moodlelib.php: call to pgsql_native_moodle_database->insert_record()
      line 1506 of \lib\upgradelib.php: call to set_config()
      line 1751 of \lib\upgradelib.php: call to upgrade_started()
      line 276 of \admin\index.php: call to install_core()
      

      Haven't looked deeply yet, but there could also be other breaking changes aside from this.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              jpataleta Jun Pataleta
              David Woloszyn, Huong Nguyen, Jake Dallimore, Meirza, Michael Hawkins, Raquel Ortega, Safat Shahin, Stevani Andolo
              Votes:
              3 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 10 minutes
                  10m