diff --git a/configure b/configure index 4157c797..b99b2479 100755 --- a/configure +++ b/configure @@ -4651,6 +4651,11 @@ if test "$have_icc_guide" = "yes" && test "$have_mysql" = "yes"; then 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 20a41063..75166e59 100644 --- a/configure.in +++ b/configure.in @@ -400,6 +400,11 @@ if test "$have_icc_guide" = "yes" && test "$have_mysql" = "yes"; then 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 836c9c42..870c29e2 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 @@ struct session_data { #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 e4b56490..aff5bcf0 100644 --- a/util/daily-report.php +++ b/util/daily-report.php @@ -97,6 +97,7 @@ $mail = new ModelMailMail(); $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; } }