Getting value of bind variables

From: Jayadevan M <Jayadevan(dot)Maymala(at)ibsplc(dot)com>
To: pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: Getting value of bind variables
Date: 2011-08-19 11:19:34
Message-ID: OF4F5BE73B.A15BD018-ON652578F1.003DB581-652578F1.003E374E@ibsplc.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hell l,
I am trying to debug a query that gives an error. The error in the
application server log is
" ERROR: operator does not exist: timestamp without time zone = character
varying
Hint: No operator matches the given name and argument type(s). You might
need to add explicit type casts.
Position: 1274"
How can I get the value of the $1,$2 etc in the query?
WHERE MST.CMPCOD= $1
AND UPPER ( CUSINDINF.FAMNAM )= UPPER ($2)
AND UPPER ( CUSINDINF.INITLS )= UPPER ($3)
AND ( CUSINDINF.MEMDOB ) = ($4)
AND MST.CUSNUM <> $5

It looks like the error is for the condition ( CUSINDINF.MEMDOB ) = ($4) ,
memdob being a date of birth (timestamp) column. When I try the query at
psql with some values, the data is retrieved OK. Is there some logging
available in PostgreSQL that will tell me what values were actually used?
As of now, I am trying with logging level set to debug5 in postgresql.conf
for all logging options. But what is the 'correct' approach?

Regards,
Jayadevan

DISCLAIMER:

"The information in this e-mail and any attachment is intended only for
the person to whom it is addressed and may contain confidential and/or
privileged material. If you have received this e-mail in error, kindly
contact the sender and destroy all copies of the original communication.
IBS makes no warranty, express or implied, nor guarantees the accuracy,
adequacy or completeness of the information contained in this email or any
attachment and is not liable for any errors, defects, omissions, viruses
or for resultant loss or damage, if any, direct or indirect."

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Fujii Masao 2011-08-19 11:27:10 Re: synchronous_standby_names with '*'
Previous Message alexondi 2011-08-19 11:04:08 Re: synchronous_standby_names with '*'