summaryrefslogtreecommitdiffstats
path: root/lib/setup.php
diff options
context:
space:
mode:
authorRobin Appelman <icewind1991@gmail.com>2012-01-08 17:49:53 +0100
committerRobin Appelman <icewind1991@gmail.com>2012-01-08 17:49:53 +0100
commit37f5a8cdb4d2486982117c5d5984a253c2192e0b (patch)
tree76f0de4abecab505d7977556e39f759cede7e9a8 /lib/setup.php
parented5fb902bd1391d2fc2adb3c4e5cb25fcb16b93e (diff)
downloadnextcloud-server-37f5a8cdb4d2486982117c5d5984a253c2192e0b.tar.gz
nextcloud-server-37f5a8cdb4d2486982117c5d5984a253c2192e0b.zip
improve pgsql database detection
Diffstat (limited to 'lib/setup.php')
-rw-r--r--lib/setup.php7
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);