diff --git a/configure b/configure index 4157c79..b99b247 100755 --- a/configure +++ b/configure @@ -4651,6 +4651,11 @@ sql_libs="$sql_libs -lguide" fi +if test "$have_psql" = "yes"; then + defs="$defs -DNEED_PSQL" +fi + + if test "$have_multitenancy" = "yes"; then echo "multitenancy support: yes" defs="$defs -DHAVE_MULTITENANCY" diff --git a/configure.in b/configure.in index 20a4106..75166e5 100644 --- a/configure.in +++ b/configure.in @@ -400,6 +400,11 @@ sql_libs="$sql_libs -lguide" fi +if test "$have_psql" = "yes"; then + defs="$defs -DNEED_PSQL" +fi + + if test "$have_multitenancy" = "yes"; then echo "multitenancy support: yes" defs="$defs -DHAVE_MULTITENANCY" diff --git a/src/defs.h b/src/defs.h index 836c9c4..870c29e 100644 --- a/src/defs.h +++ b/src/defs.h @@ -8,15 +8,8 @@ #ifdef NEED_MYSQL #include #endif -#ifdef NEED_SQLITE3 - #include - - /* for older versions of sqlite3 do not have the sqlite3_prepare_v2() function, 2009.12.30, SJ */ - - #if SQLITE_VERSION_NUMBER < 3006000 - #define sqlite3_prepare_v2 sqlite3_prepare - #endif - +#ifdef NEED_PSQL + #include #endif #ifdef HAVE_TRE #include @@ -202,8 +195,9 @@ #ifdef NEED_MYSQL MYSQL mysql; #endif -#ifdef NEED_SQLITE3 - sqlite3 *db; +#ifdef NEED_PSQL + PGconn *psql; + char conninfo[SMALLBUFSIZE]; #endif }; diff --git a/util/daily-report.php b/util/daily-report.php index e4b5649..aff5bcf 100644 --- a/util/daily-report.php +++ b/util/daily-report.php @@ -97,6 +97,7 @@ $averagesqlsizeraw = $sqlsizeraw / $counters['rcvd']; $averagesphinxsizeraw = $sphinxsizeraw / $counters['rcvd']; $averagesizedayraw = ($averagemessagesizeraw+$averagesqlsizeraw+$averagesphinxsizeraw) * $averagemessagesweekraw; + $datapart = 0; foreach($shortdiskinfo as $part) { if( $part['partition'] == DATA_PARTITION ) { $datapart = $part['freespace']*1024; } }