From 1ee636461c3fe1925731691985161a19cea64247 Mon Sep 17 00:00:00 2001 From: Sarah Hoffmann Date: Thu, 23 Aug 2018 21:14:34 +0200 Subject: [PATCH] Mute notices from postgresql during setup They are mostly warnings about tables that do not exists. This is intentional and would only confuse the casual user. --- lib/cmd.php | 4 ++++ utils/setup.php | 1 - 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/cmd.php b/lib/cmd.php index 9efe5653..10186810 100644 --- a/lib/cmd.php +++ b/lib/cmd.php @@ -185,6 +185,10 @@ function runSQLScript($sScript, $bfatal = true, $bVerbose = false, $bIgnoreError fail('unable to start pgsql'); } + if (!$bVerbose) { + fwrite($ahPipes[0], "set client_min_messages to WARNING;"); + } + while (strlen($sScript)) { $iWritten = fwrite($ahPipes[0], $sScript); if ($iWritten <= 0) break; diff --git a/utils/setup.php b/utils/setup.php index d8cceba4..b9c0166c 100755 --- a/utils/setup.php +++ b/utils/setup.php @@ -440,7 +440,6 @@ if ($aCMDResult['load-data'] || $aCMDResult['all']) { // PGSQL_EMPTY_QUERY, PGSQL_COMMAND_OK, PGSQL_TUPLES_OK, // PGSQL_COPY_OUT, PGSQL_COPY_IN, PGSQL_BAD_RESPONSE, // PGSQL_NONFATAL_ERROR and PGSQL_FATAL_ERROR - echo 'Query result ' . $i . ' is: ' . $resultStatus . "\n"; if ($resultStatus != PGSQL_COMMAND_OK && $resultStatus != PGSQL_TUPLES_OK) { $resultError = pg_result_error($hPGresult); echo '-- error text ' . $i . ': ' . $resultError . "\n"; -- 2.43.2