|
Home > Archive > PostgreSQL JDBC > November 2005 > More Verbose Logging of Statements
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
More Verbose Logging of Statements
|
|
| Rob Kirkbride 2005-11-10, 9:23 am |
| Hi,
I've been trying to understand the documentation at
http://www.postgresql.org/docs/8.0/...ime-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
---------------------------(end of broadcast)---------------------------
TIP 9: In versions below 8.0, the planner will ignore your desire to
choose an index scan if your joining column's datatypes do not
match
| |
| Kris Jurka 2005-11-10, 11:24 am |
|
On Thu, 10 Nov 2005, Rob Kirkbride wrote:
> I've been trying to understand the documentation at
> http://www.postgresql.org/docs/8.0/...ime-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
---------------------------(end of broadcast)---------------------------
TIP 4: Have you searched our list archives?
http://archives.postgresql.org
| |
| Rob Kirkbride 2005-11-10, 11:24 am |
| Kris Jurka wrote:
>
>
> On Thu, 10 Nov 2005, Rob Kirkbride wrote:
>
>
> 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
---------------------------(end of broadcast)---------------------------
TIP 4: Have you searched our list archives?
http://archives.postgresql.org
| |
| Guillaume Cottenceau 2005-11-10, 8:24 pm |
| 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#to
String()
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
---------------------------(end of broadcast)---------------------------
TIP 5: don't forget to increase your free space map settings
|
|
|
|
|