On Tue, Aug 23, 2011 at 09:07:20AM +0530, Jayadevan M wrote: > I guess so. But when I tried the same query on psql by replacing ($4) with > a value like '20110404', the query works OK. The value of $4 is being > passed from a java application. So does this mean I have to change the > data type in java code? For clarity, when you put the value '20110404' in a query, that is not a varchar. Rather it's type is coerced to whatever is most appropriate from the surrounding SQL. To generate the same error you need to put '20110404'::varchar in place of the parameter. Have a nice day, -- Martijn van Oosterhout <kleptog@xxxxxxxxx> http://svana.org/kleptog/ > He who writes carelessly confesses thereby at the very outset that he does > not attach much importance to his own thoughts. -- Arthur Schopenhauer
Attachment:
signature.asc
Description: Digital signature