pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
More Verbose Logging of Statements
4+ messages / 3 participants
[nested] [flat]

* More Verbose Logging of Statements
@ 2005-11-10 11:54 Rob Kirkbride <rob@rkcomputing.co.uk>
  2005-11-10 16:15 ` Re: More Verbose Logging of Statements Kris Jurka <books@ejurka.com>
  0 siblings, 1 reply; 4+ messages in thread

From: Rob Kirkbride @ 2005-11-10 11:54 UTC (permalink / raw)
  To: pgsql-jdbc

Hi,

I've been trying to understand the documentation at 
http://www.postgresql.org/docs/8.0/static/runtime-config.html but I 
can't get it to put into my logfile the actual contents of prepared 
statement parameters. I just get $1, $2 etc. I'd like to show me what 
those are either in the actual line or below I don't mind which.

Is there anyway to do this?

Thanks,

Rob




^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: More Verbose Logging of Statements
  2005-11-10 11:54 More Verbose Logging of Statements Rob Kirkbride <rob@rkcomputing.co.uk>
@ 2005-11-10 16:15 ` Kris Jurka <books@ejurka.com>
  2005-11-10 16:19   ` Re: More Verbose Logging of Statements Rob Kirkbride <rob@rkcomputing.co.uk>
  0 siblings, 1 reply; 4+ messages in thread

From: Kris Jurka @ 2005-11-10 16:15 UTC (permalink / raw)
  To: Rob Kirkbride <rob@rkcomputing.co.uk>; +Cc: pgsql-jdbc



On Thu, 10 Nov 2005, Rob Kirkbride wrote:

> I've been trying to understand the documentation at 
> http://www.postgresql.org/docs/8.0/static/runtime-config.html but I can't get 
> it to put into my logfile the actual contents of prepared statement 
> parameters. I just get $1, $2 etc. I'd like to show me what those are either 
> in the actual line or below I don't mind which.
>

No, the JDBC driver uses the new extended query protocol by default which 
the server does not log very well.  You could make the driver fallback to 
the older protocol by using the URL parameter ?protocolVersion=2 which is 
logged fully, but then you're not really testing the same thing if you are 
trying to debug a problem or do a performance analysis.

Kris Jurka



^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: More Verbose Logging of Statements
  2005-11-10 11:54 More Verbose Logging of Statements Rob Kirkbride <rob@rkcomputing.co.uk>
  2005-11-10 16:15 ` Re: More Verbose Logging of Statements Kris Jurka <books@ejurka.com>
@ 2005-11-10 16:19   ` Rob Kirkbride <rob@rkcomputing.co.uk>
  2005-11-10 16:52     ` Re: More Verbose Logging of Statements Guillaume Cottenceau <gc@mnc.ch>
  0 siblings, 1 reply; 4+ messages in thread

From: Rob Kirkbride @ 2005-11-10 16:19 UTC (permalink / raw)
  To: Kris Jurka <books@ejurka.com>; +Cc: pgsql-jdbc

Kris Jurka wrote:

>
>
> On Thu, 10 Nov 2005, Rob Kirkbride wrote:
>
>> I've been trying to understand the documentation at 
>> http://www.postgresql.org/docs/8.0/static/runtime-config.html but I 
>> can't get it to put into my logfile the actual contents of prepared 
>> statement parameters. I just get $1, $2 etc. I'd like to show me what 
>> those are either in the actual line or below I don't mind which.
>>
>
> No, the JDBC driver uses the new extended query protocol by default 
> which the server does not log very well.  You could make the driver 
> fallback to the older protocol by using the URL parameter 
> ?protocolVersion=2 which is logged fully, but then you're not really 
> testing the same thing if you are trying to debug a problem or do a 
> performance analysis.
>
OK. Thanks. :-( It's to debug things like where you get constraint 
violation on keys but you don't what the key was. I guess I'd have to 
try and get the client to do it - hibernate - but this tends to print $s 
as well!

Thanks,

Rob



^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: More Verbose Logging of Statements
  2005-11-10 11:54 More Verbose Logging of Statements Rob Kirkbride <rob@rkcomputing.co.uk>
  2005-11-10 16:15 ` Re: More Verbose Logging of Statements Kris Jurka <books@ejurka.com>
  2005-11-10 16:19   ` Re: More Verbose Logging of Statements Rob Kirkbride <rob@rkcomputing.co.uk>
@ 2005-11-10 16:52     ` Guillaume Cottenceau <gc@mnc.ch>
  0 siblings, 0 replies; 4+ messages in thread

From: Guillaume Cottenceau @ 2005-11-10 16:52 UTC (permalink / raw)
  To: Rob Kirkbride <rob@rkcomputing.co.uk>; +Cc: pgsql-jdbc

Rob Kirkbride <rob 'at' rkcomputing.co.uk> writes:

> OK. Thanks. :-( It's to debug things like where you get constraint
> violation on keys but you don't what the key was. I guess I'd have to
> try and get the client to do it - hibernate - but this tends to print
> $s as well!

If it could be of some help - I use PreparedStatement#toString()
in my code for such things. It has the problem of not quoting the
strings properly but other that that it's cool. Maybe hibernate
has some sort of options for doing this? (I don't use it) (yet)

-- 
Guillaume Cottenceau



^ permalink  raw  reply  [nested|flat] 4+ messages in thread


end of thread, other threads:[~2005-11-10 16:52 UTC | newest]

Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2005-11-10 11:54 More Verbose Logging of Statements Rob Kirkbride <rob@rkcomputing.co.uk>
2005-11-10 16:15 ` Kris Jurka <books@ejurka.com>
2005-11-10 16:19   ` Rob Kirkbride <rob@rkcomputing.co.uk>
2005-11-10 16:52     ` Guillaume Cottenceau <gc@mnc.ch>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox