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
Run-time Configuration
Valid values are DEBUG5>,
DEBUG4>, DEBUG3>, DEBUG2>,
DEBUG1>, LOG>, NOTICE>,
- WARNING>, and ERROR>. Each level
+ WARNING>, ERROR>, FATAL>,
+ and PANIC>. Each level
includes all the levels that follow it. The later the level,
the fewer messages are sent. The default is
NOTICE>. Note that LOG> has a different
*
* 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"
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();
}