pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Do, Leon \(Leon\) <leondo@lucent.com>
To: Dave Cramer <pg@fastcrypt.com>
Cc: pgsql-jdbc@postgresql.org
Subject: Re: help with front/backend datatype converting
Date: Fri, 10 Nov 2006 16:27:52 -0600
Message-ID: <D1EE06BA46B1E4449AF9A4F2FBEE1861223CD7@ILEXC2U01.ndc.lucent.com> (raw)
In-Reply-To: <5366BF7A-226B-443C-97A6-7AAE5F603BA2@fastcrypt.com>

 

Dave,

 

I see you raised a lot of issues about this problem but I don't have any
suggestion as of now.  I'll think about it.

 

On the side, the timezone for timestamp is always sending in this
format:

2006-11-10 14:36:19.213000 -0500

 

should it be

2006-11-10 14:36:19.213000 -05:00

 

with the colon between hour and min?

 

thanks again

 

Leon Do

 

 

 

 

 

________________________________

From: Dave Cramer [mailto:pg@fastcrypt.com] 
Sent: Friday, November 10, 2006 4:15 PM
To: Do, Leon (Leon)
Cc: pgsql-jdbc@postgresql.org
Subject: Re: [JDBC] help with front/backend datatype converting

 

Hi Leon,

 

No, currently there is no way to do this. It is possible, but this is
probably the worst data type to try this with. Postgresql has two
timestamp types, 1 with timezone, 1 without, jdbc has no knowledge of
this. Do you have suggestions on how to resolve this ? Also consider the
actual timezone, what if the timezone of the server is different than
the timezone of the client. To add to the problem, it is possible for
the server to keep dates/timestamps as 64bit integers, or Floating point
values. The client has to send the data in exactly the right format.

 

Sorry to only outline the problems without constructive solutions.

 

Dave

 

On 10-Nov-06, at 3:58 PM, Do, Leon (Leon) wrote:





Hi,

 

It looks like PostgreSQL JDBC always converting a column value to text
before sending it to the Backend server.  Is there a way to stop this
behavior?

 

I am using the following piece of code to set the timestamp value:

 

new

prepstmt.setBinaryStream(1,is,bdata.);                java.sql.Timestamp
sqltime =  

 

When the backend server receives the parse message, the oid type for
binary data is set but the oid type for timestamp is not set.

When the bind message arrives, the format type for binary data is binary
and the format type for timestamp is text and there is no way to know
what is the type of the value anymore.   Can I configure to disable text
converting feature?

thanks

 

 

Leon Do

Lucent Technologies

Mobility Software Engineer

 

 





 

view thread (17+ messages)  latest in thread

Message-ID: <D1EE06BA46B1E4449AF9A4F2FBEE1861223CD7@ILEXC2U01.ndc.lucent.com>
Permalink:  ../D1EE06BA46B1E4449AF9A4F2FBEE1861223CD7@ILEXC2U01.ndc.lucent.com/
Also on:    postgresql.org/message-id/D1EE06BA46B1E4449AF9A4F2FBEE1861223CD7@ILEXC2U01.ndc.lucent.com

 · 

reply

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: leondo@lucent.com, pg@fastcrypt.com
  Subject: Re: help with front/backend datatype converting
  In-Reply-To: <D1EE06BA46B1E4449AF9A4F2FBEE1861223CD7@ILEXC2U01.ndc.lucent.com>
  References: <5366BF7A-226B-443C-97A6-7AAE5F603BA2@fastcrypt.com> <D1EE06BA46B1E4449AF9A4F2FBEE1861223CD7@ILEXC2U01.ndc.lucent.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