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

Logging/Viewing parameters of a prepared statement

From: "Amit Phatarphekar" <amit(at)visionaire-us(dot)com>
To: <pgsql-general(at)postgresql(dot)org>
Subject: Logging/Viewing parameters of a prepared statement
Date: 2008-03-31 02:25:48
Message-ID: DC4ED4C8F48DE14F9158F9DEDFFD6EC4ABD369@exch2003.visionaire.lcl (view raw or flat)
Thread:
Lists: pgsql-general
I'm using Version-8.1.4 and JDBC-3 jar

 

I call a db function from my java code, using a prepared statement.

 

When I look at the logs of postgres in data/pg_log, the statement
executed appears like for example

"select * from get_user($1)" 

 

It would be nice if I can somehow know the value of $1 passed in.  So
Ideally a statement like 

"select * from get_user(1234)" (where 1234 is $1), would be more
helpful.  

 

This is all in efforts to make debugging easier.  For instance using MS
SQL Server's Profiler, you can monitor 

all statements executing on the db.  I'm trying to achieve that on
postgres.

 

I've configured the log_statement='all' in postgresql.conf.

 

Thanks

Amit

Responses

pgsql-general by date

Next:From: Craig RingerDate: 2008-03-31 02:52:53
Subject: Re: returning array from function or "structured error"
Previous:From: Tom LaneDate: 2008-03-31 01:40:52
Subject: Re: shortcut for select * where id in (arrayvar)

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