Обсуждение: CONTEXT messages for raise EXCEPTION

Поиск
Список
Период
Сортировка

CONTEXT messages for raise EXCEPTION

От
"Michael Shapiro"
Дата:
I am getting a lot of CONTEXT information along with the message when an EXCEPTION is raised. Does anyone know what controls whether EXCEPTIONS add the CONTEXT or not? This problem appeared recently in our server - 8.1.9/linux - but none as far as we can tell we have not changed the configuration. Obviously something did change, but we don't know where to look. Any help would be appreciated.

Here is a sample error message with the CONTEXT

DBD::Pg::db do failed: ERROR:  INSERT BEFORE jobs
 CONTEXT:  SQL statement "insert into jobs (account_id, resource_id, system_account_id, local_jobid, local_charge, submit_time, start_time, end_time, wallduration, jobname, nodecount, processors, queue, grid_job_id) values ( $1 ,  $2 ,  $3 ,  $4 ,  $5 ,  $6 ,  $7 ,  $8 ,  $9 ,  $10 ,  $11 ,  $12 ,  $13 ,  $14 )"

NOTE:  We are using Perl's DBI (which may or not be the cause).

Re: CONTEXT messages for raise EXCEPTION

От
Michael Fuhr
Дата:
On Wed, Feb 13, 2008 at 11:27:16AM -0600, Michael Shapiro wrote:
> I am getting a lot of CONTEXT information along with the message when an
> EXCEPTION is raised. Does anyone know what controls whether EXCEPTIONS add
> the CONTEXT or not?

In the server logs the log_error_verbosity configuration setting
controls how much much detail is logged.  For client-side display,
in psql you can use the VERBOSITY variable.

> NOTE:  We are using Perl's DBI (which may or not be the cause).

For client-side display, see the pg_errorlevel database handle
attribute in the DBD::Pg manual page.

$dbh->{pg_errorlevel} = 0;  # terse
$dbh->{pg_errorlevel} = 1;  # default
$dbh->{pg_errorlevel} = 2;  # verbose

--
Michael Fuhr

Re: CONTEXT messages for raise EXCEPTION

От
"Michael Shapiro"
Дата:
The $dbh->{errorlevel} is set to 1 (default), which implies the extra verbosity is some setting in the server, right?
The server log_error_verbosity is set to terse, so the server shouldn't add the CONTEXT.

I remain baffled by what I am seeing.


On Feb 13, 2008 1:11 PM, Michael Fuhr <mike@fuhr.org> wrote:
On Wed, Feb 13, 2008 at 11:27:16AM -0600, Michael Shapiro wrote:
> I am getting a lot of CONTEXT information along with the message when an
> EXCEPTION is raised. Does anyone know what controls whether EXCEPTIONS add
> the CONTEXT or not?

In the server logs the log_error_verbosity configuration setting
controls how much much detail is logged.  For client-side display,
in psql you can use the VERBOSITY variable.

> NOTE:  We are using Perl's DBI (which may or not be the cause).

For client-side display, see the pg_errorlevel database handle
attribute in the DBD::Pg manual page.

$dbh->{pg_errorlevel} = 0;  # terse
$dbh->{pg_errorlevel} = 1;  # default
$dbh->{pg_errorlevel} = 2;  # verbose

--
Michael Fuhr

Re: CONTEXT messages for raise EXCEPTION

От
"Michael Shapiro"
Дата:
I tried setting dbh->{pg_errorlevel} = 0 and 2
Neither setting produced the CONTEXT messages. 0 wasn't any different that 1, and 2 added
LOCATION:  exec_stmt_raise, pl_exec.c:2113


On Feb 13, 2008 1:11 PM, Michael Fuhr <mike@fuhr.org> wrote:
On Wed, Feb 13, 2008 at 11:27:16AM -0600, Michael Shapiro wrote:
> I am getting a lot of CONTEXT information along with the message when an
> EXCEPTION is raised. Does anyone know what controls whether EXCEPTIONS add
> the CONTEXT or not?

In the server logs the log_error_verbosity configuration setting
controls how much much detail is logged.  For client-side display,
in psql you can use the VERBOSITY variable.

> NOTE:  We are using Perl's DBI (which may or not be the cause).

For client-side display, see the pg_errorlevel database handle
attribute in the DBD::Pg manual page.

$dbh->{pg_errorlevel} = 0;  # terse
$dbh->{pg_errorlevel} = 1;  # default
$dbh->{pg_errorlevel} = 2;  # verbose

--
Michael Fuhr

Re: CONTEXT messages for raise EXCEPTION

От
Tom Lane
Дата:
"Michael Shapiro" <mshapiro51@gmail.com> writes:
> The $dbh->{errorlevel} is set to 1 (default), which implies the extra
> verbosity is some setting in the server, right?
> The server log_error_verbosity is set to terse, so the server shouldn't add
> the CONTEXT.

log_error_verbosity just controls what goes into the server log.

The amount of detail shown on the client side is entirely determined by
client-side logic.  If DBD::Pg hasn't got a knob that lets you suppress
the CONTEXT field, you'll need to take that up with the DBD::Pg authors.

            regards, tom lane