aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBruce Momjian <bruce@momjian.us>2005-10-13 20:58:42 +0000
committerBruce Momjian <bruce@momjian.us>2005-10-13 20:58:42 +0000
commit8ac386226d76b29a9f54c26b157e04e9b8368606 (patch)
tree6d001a7bc49f704ccea570180c9d772680a2ebe5 /src
parent478479427993b795a670ab6d2785e46e446d09d6 (diff)
downloadpostgresql-8ac386226d76b29a9f54c26b157e04e9b8368606.tar.gz
postgresql-8ac386226d76b29a9f54c26b157e04e9b8368606.zip
The patch updates the documentation to reflect the fact that higher values
of client_min_messages (fatal + panic) are valid and also fixes a slight issue with how psql tried to display error messages that aren't sent to the client. We often tell people to ignore errors in response to requests for things like "drop if exists", but there's no good way to completely hide this without upping client_min_messages past ERROR. When running a file like SET client_min_messages TO 'FATAL'; DROP TABLE doesntexist; with "psql -f filename" you get an error prefix of "psql:/home/username/filename:3" even though there is no error message to prefix because it isn't sent to the client. Kris Jurka
Diffstat (limited to 'src')
-rw-r--r--src/bin/psql/common.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/bin/psql/common.c b/src/bin/psql/common.c
index 9b087adf010..886bcde1786 100644
--- a/src/bin/psql/common.c
+++ b/src/bin/psql/common.c
@@ -3,7 +3,7 @@
*
* Copyright (c) 2000-2005, PostgreSQL Global Development Group
*
- * $PostgreSQL: pgsql/src/bin/psql/common.c,v 1.106 2005/10/04 19:01:18 petere Exp $
+ * $PostgreSQL: pgsql/src/bin/psql/common.c,v 1.107 2005/10/13 20:58:42 momjian Exp $
*/
#include "postgres_fe.h"
#include "common.h"
@@ -681,7 +681,10 @@ AcceptResult(const PGresult *result, const char *query)
if (!OK)
{
- psql_error("%s", PQerrorMessage(pset.db));
+ const char *error = PQerrorMessage(pset.db);
+ if (strlen(error))
+ psql_error("%s", error);
+
ReportSyntaxErrorPosition(result, query);
CheckConnection();
}