Problem/Motivation
The minimum required version of PostgreSQL is 10. In the Connection class of the PostgreSQL driver we have the following code:
public function upsert($table, array $options = []) {
// Use the (faster) native Upsert implementation for PostgreSQL >= 9.5.
if (version_compare($this->version(), '9.5', '>=')) {
$class = $this->getDriverClass('NativeUpsert');
}
else {
$class = $this->getDriverClass('Upsert');
}
return new $class($this, $table, $options);
}
The method is no longer necessary.
Proposed resolution
1. Remove the method Drupal\Core\Database\Driver\pgsql\Connection::upsert()
.
2. Then remove the class Drupal\Core\Database\Driver\pgsql\Upsert
.
3. After that rename the class Drupal\Core\Database\Driver\pgsql\NativeUpsert
to Drupal\Core\Database\Driver\pgsql\Upsert
.
4. In the renamed class, change the class name from "NativeUpsert" to "Upsert" and remove the link to http://www.postgresql.org/docs/9.5/static/sql-insert.html#SQL-ON-CONFLICT.
5. The file "core/modules/system/tests/modules/driver_test/src/Driver/Database/DrivertestPgsql/NativeUpsert.php" can also be removed.
Remaining tasks
TBD
User interface changes
None
API changes
None
Data model changes
None
Release notes snippet
TBD