1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-02 09:02:37 +03:00

Revise syntax-error reporting behavior to give pleasant results for

errors in internally-generated queries, such as those submitted by
plpgsql functions.  Per recent discussions with Fabien Coelho.
This commit is contained in:
Tom Lane
2004-03-21 22:29:11 +00:00
parent bee3b2a0a0
commit f938c2b91b
25 changed files with 671 additions and 124 deletions

View File

@ -3,7 +3,7 @@
*
* Copyright (c) 2000-2003, PostgreSQL Global Development Group
*
* $PostgreSQL: pgsql/src/bin/psql/command.c,v 1.113 2004/02/19 19:40:08 tgl Exp $
* $PostgreSQL: pgsql/src/bin/psql/command.c,v 1.114 2004/03/21 22:29:11 tgl Exp $
*/
#include "postgres_fe.h"
#include "command.h"
@ -1042,18 +1042,20 @@ SyncVerbosityVariable(void)
"default", "terse", "verbose", NULL))
{
case 1: /* default */
PQsetErrorVerbosity(pset.db, PQERRORS_DEFAULT);
pset.verbosity = PQERRORS_DEFAULT;
break;
case 2: /* terse */
PQsetErrorVerbosity(pset.db, PQERRORS_TERSE);
pset.verbosity = PQERRORS_TERSE;
break;
case 3: /* verbose */
PQsetErrorVerbosity(pset.db, PQERRORS_VERBOSE);
pset.verbosity = PQERRORS_VERBOSE;
break;
default: /* not set or unrecognized value */
PQsetErrorVerbosity(pset.db, PQERRORS_DEFAULT);
pset.verbosity = PQERRORS_DEFAULT;
break;
}
PQsetErrorVerbosity(pset.db, pset.verbosity);
}