Search Postgresql Archives

Re: Getting value of bind variables

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux