preg_match("/^INSERT INTO\s+`?([a-z0-9_]+)`?/i", $query, $matches);
SHOULD BE CHANGED TO:
preg_match("/^INSERT INTO\s+[\"`]?([a-z0-9_]+)[\"`]?/i", $sql, $matches);
BECAUSE $sql is the rewritten statement. Also modified RE so " and ` are both matched when around tableName. using $query produces errors when the original query was "INSERT IGNORE INTO"
2. driver_pgsql.php: 557:
$GLOBALS['pg4wp_ins_id'] = $row[$primaryKey];
SHOULD BE wrapped with:
if (is_array($row) && $primaryKey) { ... }
BECAUSE $row returns a bool WHEN original query was "INSERT IGNORE INTO" which got changed into "ON CONFLICT DO NOTHING" and then returned empty results, since it did nothing.
1. driver_pgsql.php: 550:
2. driver_pgsql.php: 557: