Skip site navigation (1) Skip section navigation (2)

Re: Logging failed sql commands trough jdbc?

From: "Guillaume Smet" <guillaume(dot)smet(at)gmail(dot)com>
To: mario(dot)splivalo(at)mobart(dot)hr
Cc: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: Logging failed sql commands trough jdbc?
Date: 2007-02-19 15:30:21
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-jdbc
Hi Mario,

On 2/19/07, Mario Splivalo <mario(dot)splivalo(at)mobart(dot)hr> wrote:
> I'm using pg74.215.jdbc3.jar  with PostgreSQL 8.1.2. I'm not using jdbc
> driver for postgres 8 because of prepared transactions wich makes my
> postgres log file look like this:
> 2007-02-19 15:02:51.299 CET [32228] <testDb> SELECTLOG:  duration:
> 2481.387 ms  statement: EXECUTE <unnamed>  [PREPARE:  select * from
> update_message_status($1, $2, $3, $4, $5, $6, $7) as result]

In fact, you can use 8.1 driver with ?protocolVersion=2.

> Is there a way to force postgres to display those parameters, or to
> force JDBC to log all the queries sent to postgres? Even better, can
> postgres show the parametars in the 'SELECTCONTEXT' line above (instead
> of $1, $2, $3?) I don't need prepared transactions for production
> (although I'm not sure about the speed improvement - not that my test
> were accurate).

If you can plan a migration to PostgreSQL 8.2, values of the
parameters are now logged so it should solve your problem.


In response to

pgsql-jdbc by date

Next:From: Kris JurkaDate: 2007-02-19 18:37:04
Subject: Re: NPE in BlobInputStream
Previous:From: Andrew SullivanDate: 2007-02-19 14:36:08
Subject: Re: query using JDBC with postgresql

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group