Re: CONTEXT messages for raise EXCEPTION

Lists: pgsql-admin
From: "Michael Shapiro" <mshapiro51(at)gmail(dot)com>
To: pgsql-admin(at)postgresql(dot)org(dot)
Subject: CONTEXT messages for raise EXCEPTION
Date: 2008-02-13 17:27:16
Message-ID: ca3a8da20802130927u1abe9c2cgf67dfe83bb159592@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-admin

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).


From: Michael Fuhr <mike(at)fuhr(dot)org>
To: Michael Shapiro <mshapiro51(at)gmail(dot)com>
Cc: pgsql-admin(at)postgresql(dot)org
Subject: Re: CONTEXT messages for raise EXCEPTION
Date: 2008-02-13 19:11:36
Message-ID: 20080213191136.GA91063@winnie.fuhr.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-admin

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


From: "Michael Shapiro" <mshapiro51(at)gmail(dot)com>
To: "Michael Fuhr" <mike(at)fuhr(dot)org>
Cc: pgsql-admin(at)postgresql(dot)org
Subject: Re: CONTEXT messages for raise EXCEPTION
Date: 2008-02-13 19:25:47
Message-ID: ca3a8da20802131125if8cb921h2912f2b41c262bb0@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-admin

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(at)fuhr(dot)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
>


From: "Michael Shapiro" <mshapiro51(at)gmail(dot)com>
To: "Michael Fuhr" <mike(at)fuhr(dot)org>
Cc: pgsql-admin(at)postgresql(dot)org
Subject: Re: CONTEXT messages for raise EXCEPTION
Date: 2008-02-13 19:32:30
Message-ID: ca3a8da20802131132i11fa274ere86300a5ed78e743@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-admin

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(at)fuhr(dot)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
>


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Michael Shapiro" <mshapiro51(at)gmail(dot)com>
Cc: "Michael Fuhr" <mike(at)fuhr(dot)org>, pgsql-admin(at)postgresql(dot)org
Subject: Re: CONTEXT messages for raise EXCEPTION
Date: 2008-02-13 20:18:01
Message-ID: 22805.1202933881@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-admin

"Michael Shapiro" <mshapiro51(at)gmail(dot)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