diff --git a/lib/adodb/drivers/adodb-postgres8.inc.php b/lib/adodb/drivers/adodb-postgres8.inc.php index f1b857612e5..cd1b8925185 100644 --- a/lib/adodb/drivers/adodb-postgres8.inc.php +++ b/lib/adodb/drivers/adodb-postgres8.inc.php @@ -20,6 +20,12 @@ class ADODB_postgres8 extends ADODB_postgres7 { var $databaseType = 'postgres8'; + // From PostgreSQL 8.0 onwards, the adsrc column used in earlier versions to + // retrieve the default value is obsolete and should not be used (see #562). + var $metaDefaultsSQL = "SELECT d.adnum as num, pg_get_expr(d.adbin, d.adrelid) as def + FROM pg_attrdef d, pg_class c + WHERE d.adrelid=c.oid AND c.relname='%s' + ORDER BY d.adnum"; /** * Retrieve last inserted ID diff --git a/lib/adodb/readme_moodle.txt b/lib/adodb/readme_moodle.txt index 35c450a12b6..7e7236fc35c 100644 --- a/lib/adodb/readme_moodle.txt +++ b/lib/adodb/readme_moodle.txt @@ -31,5 +31,6 @@ Our changes: * MDL-52286 Added muting erros in ADORecordSet::__destruct(). Check if fixed upstream during the next upgrade and remove this note. (8638b3f1441d4b928) * MDL-67034 Fixes to make the library php74 compliant. + * MDL-67414 Fix to make the library PostgreSQL 12.x compliant (upstream: a4876f100602c2ce4). -skodak, iarenaza, moodler, stronk7, abgreeve, lameze, ankitagarwal, marinaglancy +skodak, iarenaza, moodler, stronk7, abgreeve, lameze, ankitagarwal, marinaglancy, matteo