Re: Column is of type date but expression is of type text

From: list_usr(at)spacebox(dot)net
To: Kris Jurka <books(at)ejurka(dot)com>
Cc: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: Column is of type date but expression is of type text
Date: 2010-02-20 04:24:56
Message-ID: 1e11c2271002192024p1d6d064fu8cca2494383bba4c@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

Would the problem be that the timezone is included with the date
passed in the stored procedure parameter?

I don't understand why the timezone shows up in my J2EE app but not in
the test code you sent.

On Fri, Feb 19, 2010 at 8:21 PM, <list_usr(at)spacebox(dot)net> wrote:
> Re: version, good question - I have both postgresql-8.4-701.jdbc3.jar
> and postgresql-8.4-701.jdbc4.jar in my Apache Tomcat 5.5 common/lib
> directory.  Would that cause a problem?
>
> I'm using PostgreSQL 8.4.  Java 1.6.
>
> Your example code worked with both jdbc3 and jdbc4, but my code still
> isn't working.
>
> I thought it might have to do with the way I instantiate the date, but
> I tried that in your example code and it worked fine:
>
> SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
> birthdate.setTime(format.parse(request.getParameter("birthdate")).getTime());
> // getParameter("birthdate") would return "1978-02-13" for example
>
> In my app the PostgreSQL logs show the birthdate parameter as
> "1978-02-13 -04:00:00", with the same code in your test program the
> time is omitted.  Would that make a difference?
>
>
> On Thu, Feb 18, 2010 at 5:11 PM, Kris Jurka <books(at)ejurka(dot)com> wrote:
>>
>>
>> On Thu, 18 Feb 2010, list_usr(at)spacebox(dot)net wrote:
>>
>>> Here is the stored procedure in question:
>>
>> The attached testcase works fine for me.  What driver and server versions do
>> you have?
>>
>>>
>>> As an aside, how do most people name their IN parameters so as not to
>>> have them conflict with actual column names?
>>>
>>
>> Some people prefix them with v_ to indicate that they are variables.
>>
>> Kris Jurka
>

In response to

Browse pgsql-jdbc by date

  From Date Subject
Next Message Kris Jurka 2010-02-20 19:21:40 Re: Column is of type date but expression is of type text
Previous Message list_usr 2010-02-20 01:21:30 Re: Column is of type date but expression is of type text