diff options
author | Robin Appelman <icewind1991@gmail.com> | 2012-01-08 17:49:53 +0100 |
---|---|---|
committer | Robin Appelman <icewind1991@gmail.com> | 2012-01-08 17:49:53 +0100 |
commit | 37f5a8cdb4d2486982117c5d5984a253c2192e0b (patch) | |
tree | 76f0de4abecab505d7977556e39f759cede7e9a8 /lib/setup.php | |
parent | ed5fb902bd1391d2fc2adb3c4e5cb25fcb16b93e (diff) | |
download | nextcloud-server-37f5a8cdb4d2486982117c5d5984a253c2192e0b.tar.gz nextcloud-server-37f5a8cdb4d2486982117c5d5984a253c2192e0b.zip |
improve pgsql database detection
Diffstat (limited to 'lib/setup.php')
-rw-r--r-- | lib/setup.php | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/setup.php b/lib/setup.php index ebe7a45a1f6..1b74e945196 100644 --- a/lib/setup.php +++ b/lib/setup.php @@ -190,9 +190,12 @@ class OC_Setup { } //fill the database if needed - $query = "SELECT relname FROM pg_class WHERE relname='{$dbtableprefix}users' limit 1"; + $query = "select count(*) FROM pg_class WHERE relname='{$dbtableprefix}users' limit 1"; $result = pg_query($connection, $query); - if(!$result) { + if($result){ + $row = pg_fetch_row($result); + } + if(!$result or $row[0]==0) { OC_DB::createDbFromStructure('db_structure.xml'); } pg_close($connection); |