Re: Problem with DATE

From: Lachezar Dobrev <l(dot)dobrev(at)gmail(dot)com>
To: Dave Cramer <pg(at)fastcrypt(dot)com>
Cc: Vinayak <vinpokale(at)gmail(dot)com>, List <pgsql-jdbc(at)postgresql(dot)org>
Subject: Re: Problem with DATE
Date: 2015-01-13 15:28:15
Message-ID: CA+xsaB2b_fzVjnEyZGZghjfBbWe5=NppXK0ObsGU-tJs+3PDpQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

This does not seem to be true.

Quote: AbstractJdbc2Connection:194-199

/*
* Does not pass unit tests because unit tests expect setDate to have
* millisecond accuracy whereas the binary transfer only supports
* date accuracy.
*/
useBinarySendForOids.remove(Oid.DATE);

And if the date is not sent in binary form, then it is sent as UNSPECIFIED:
Quote: AbstractJdbc2Statement:3319

bindString(i, connection.getTimestampUtils().toString(cal, d),
Oid.UNSPECIFIED);

2015-01-13 13:45 GMT+02:00 Dave Cramer <pg(at)fastcrypt(dot)com>:
> No there is no similar problem for Date as there is only one date type in
> postgresql. If all you need is date then you should able to use that
>
> Dave Cramer
>
> dave.cramer(at)credativ(dot)ca
> http://www.credativ.ca
>
> On 13 January 2015 at 01:42, Vinayak <vinpokale(at)gmail(dot)com> wrote:
>>
>> Hi,
>>
>> I have checked the below description in one post:
>> If the timestamp parameter is given, the jdbc does not know if it is to be
>> used timestamp or timestamptz. The jdbc driver passes it to the server as
>> an
>> unknown data type letting the server figure out what to do with it.
>> Example:
>> timestampcol = ? or if you're inserting into a timestamp field so the
>> server
>> can determine the datatype of parameter being used at, in this case since
>> its just being sent back to the user the server cannot determine the data
>> type.
>> so we need to typecast it.
>> "SELECT ?::timestamp"
>>
>> Is the same problem for date type also?
>>
>>
>>
>>
>> -----
>> Regards,
>> Vinayak,
>>
>> --
>> View this message in context:
>> http://postgresql.nabble.com/Problem-with-DATE-tp5833008p5833708.html
>> Sent from the PostgreSQL - jdbc mailing list archive at Nabble.com.
>>
>>
>> --
>> Sent via pgsql-jdbc mailing list (pgsql-jdbc(at)postgresql(dot)org)
>> To make changes to your subscription:
>> http://www.postgresql.org/mailpref/pgsql-jdbc
>
>

In response to

Browse pgsql-jdbc by date

  From Date Subject
Next Message Vinayak 2015-01-14 05:34:57 Re: Problem with DATE
Previous Message Dave Cramer 2015-01-13 11:45:56 Re: Problem with DATE