From: list_usr@spacebox.net
To: Kris Jurka <books@ejurka.com>
Cc: pgsql-jdbc@postgresql.org
Subject: Re: Column is of type date but expression is of type text
Date: Fri, 19 Feb 2010 20:21:30 -0500
Message-ID: <1e11c2271002191721hbce2124r189dbecebe78bcd@mail.gmail.com> (raw)
In-Reply-To: <alpine.BSO.2.00.1002181708530.7153@leary.csoft.net>
References: <1e11c2271002171814i704d31f4oca1d819dc5a02103@mail.gmail.com>
<alpine.BSO.2.00.1002180017340.30823@leary.csoft.net>
<1e11c2271002181327g52545a34u6a91c5b17cd1fdfd@mail.gmail.com>
<alpine.BSO.2.00.1002181708530.7153@leary.csoft.net>
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@ejurka.com> wrote:
>
>
> On Thu, 18 Feb 2010, list_usr@spacebox.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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-jdbc@postgresql.org
Cc: list_usr@spacebox.net, books@ejurka.com
Subject: Re: Column is of type date but expression is of type text
In-Reply-To: <1e11c2271002191721hbce2124r189dbecebe78bcd@mail.gmail.com>
References: <1e11c2271002171814i704d31f4oca1d819dc5a02103@mail.gmail.com> <alpine.BSO.2.00.1002180017340.30823@leary.csoft.net> <1e11c2271002181327g52545a34u6a91c5b17cd1fdfd@mail.gmail.com> <alpine.BSO.2.00.1002181708530.7153@leary.csoft.net> <1e11c2271002191721hbce2124r189dbecebe78bcd@mail.gmail.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox