summaryrefslogtreecommitdiffstats
path: root/lib/private/legacy/OC_Util.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib/private/legacy/OC_Util.php')
-rw-r--r--lib/private/legacy/OC_Util.php9
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/private/legacy/OC_Util.php b/lib/private/legacy/OC_Util.php
index bf9ed6e29ff..4778fe33097 100644
--- a/lib/private/legacy/OC_Util.php
+++ b/lib/private/legacy/OC_Util.php
@@ -69,6 +69,7 @@ use OC\AppFramework\Http\Request;
use OC\Files\SetupManager;
use OCP\Files\Template\ITemplateManager;
use OCP\IConfig;
+use OCP\IDBConnection;
use OCP\IGroupManager;
use OCP\IURLGenerator;
use OCP\IUser;
@@ -749,9 +750,13 @@ class OC_Util {
$dbType = \OC::$server->getSystemConfig()->getValue('dbtype', 'sqlite');
if ($dbType === 'pgsql') {
// check PostgreSQL version
+ // TODO latest postgresql 8 released was 8 years ago, maybe remove the
+ // check completely?
try {
- $result = \OC_DB::executeAudited('SHOW SERVER_VERSION');
- $data = $result->fetchRow();
+ /** @var IDBConnection $connection */
+ $connection = \OC::$server->get(IDBConnection::class);
+ $result = $connection->executeQuery('SHOW SERVER_VERSION');
+ $data = $result->fetch();
$result->closeCursor();
if (isset($data['server_version'])) {
$version = $data['server_version'];