Received: from localhost (uranus.hub.org [200.46.204.60]) by postgresql.org (Postfix) with ESMTP id 655379FA4C3 for ; Fri, 10 Nov 2006 17:15:13 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.60]) (amavisd-new, port 10024) with ESMTP id 50542-04 for ; Fri, 10 Nov 2006 17:15:10 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey- Received: from net2.micro-automation.com (net2.micro-automation.com [64.7.141.29]) by postgresql.org (Postfix) with SMTP id A93F09FA61D for ; Fri, 10 Nov 2006 17:15:09 -0400 (AST) Received: (qmail 14430 invoked from network); 10 Nov 2006 21:15:07 -0000 Received: from dcdsl.ebox.com (HELO ?192.168.1.2?) (davec@64.7.143.116) by net2.micro-automation.com with SMTP; 10 Nov 2006 21:15:07 -0000 In-Reply-To: References: Mime-Version: 1.0 (Apple Message framework v752.2) Content-Type: multipart/alternative; boundary=Apple-Mail-70-202512434 Message-Id: <5366BF7A-226B-443C-97A6-7AAE5F603BA2@fastcrypt.com> Cc: From: Dave Cramer Subject: Re: help with front/backend datatype converting Date: Fri, 10 Nov 2006 16:15:06 -0500 To: "Do, Leon (Leon)" X-Mailer: Apple Mail (2.752.2) X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200611/55 X-Sequence-Number: 16097 --Apple-Mail-70-202512434 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed 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: > > > > ByteArrayInputStream is = new ByteArrayInputStream(bdata); > > > > prepstmt.setBinaryStream(1,is,bdata.length); > > > > java.sql.Timestamp sqltime = new > > java.sql.Timestamp > (System.currentTimeMillis()); > > prepstmt.setTimestamp(2,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 > > > > > > --Apple-Mail-70-202512434 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=ISO-8859-1 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,=A0

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

=A0

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

ByteArrayInputStream is =3D new ByteArrayInputStream(bdata);

prepstmt.setBinaryStream(1,is,bdata.length);

=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0

java.sql.Timestamp sqltime =3D new=A0

=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0= =A0=A0=A0=A0=A0=A0=A0=A0=A0 java.sql.Timestamp(System.currentTimeMillis());

prepstmt.setTimestamp(2,sqltime);=A0

=A0

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.=A0

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.=A0=A0 Can I configure = to disable text converting feature?

=A0

thanks

=A0

=A0

Leon Do

Lucent Technologies

Mobility Software = Engineer


= --Apple-Mail-70-202512434--