X-Original-To: pgsql-odbc-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 7279032A131 for ; Thu, 30 Sep 2004 01:00:23 +0100 (BST) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 52260-03 for ; Wed, 29 Sep 2004 23:59:58 +0000 (GMT) Received: from mta10.srv.hcvlny.cv.net (mta10.srv.hcvlny.cv.net [167.206.5.85]) by svr1.postgresql.org (Postfix) with ESMTP id D501F32A081 for ; Thu, 30 Sep 2004 00:59:30 +0100 (BST) Received: from amirlaptop (ool-44c2a474.dyn.optonline.net [68.194.164.116]) by mta10.srv.hcvlny.cv.net (iPlanet Messaging Server 5.2 HotFix 1.25 (built Mar 3 2004)) with ESMTP id <0I4T007OSULATZ@mta10.srv.hcvlny.cv.net> for pgsql-odbc@postgresql.org; Wed, 29 Sep 2004 19:58:23 -0400 (EDT) Date: Wed, 29 Sep 2004 19:58:28 -0400 From: amir Subject: \n converted to \r\n To: pgsql-odbc@postgresql.org Message-id: <0I4T007OTULATZ@mta10.srv.hcvlny.cv.net> MIME-version: 1.0 X-MIMEOLE: Produced By Microsoft MimeOLE V6.00.2800.1441 X-Mailer: Microsoft Office Outlook, Build 11.0.6353 Content-type: multipart/alternative; boundary="Boundary_(ID_03RHmtUNJX0uBsSCQl2gXg)" Thread-index: AcSmgDah2cnDtrVhSNWD2GAJHaDvuA== X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.1 tagged_above=0.0 required=5.0 tests=HTML_60_70, HTML_MESSAGE X-Spam-Level: X-Archive-Number: 200410/7 X-Sequence-Number: 4482 This is a multi-part message in MIME format. --Boundary_(ID_03RHmtUNJX0uBsSCQl2gXg) Content-type: text/plain; charset=US-ASCII Content-transfer-encoding: 7BIT Hello, I'm currently running version 07_03_0200 of the Insight Distribution Systems PostgreSQL Driver for windows. when I retrieve col1 string from the database using: "SELECT * FROM MyTable WHERE col1='hello\n'" the value returned for col1 through the driver is "hello\r\n", and I want it to be as it is stored in the database ('hello\n" with no \r). Is this a configuration issue? If so, where can I change the configuration to ensure that this conversion won't happen? Thanx in advance for your help, amir This is a mailing list thread I ran across that had the same problem. I tried contacting Byron, but his email is no longer valid: Date: Fri, 09 Apr 1999 18:46:00 -0400 From: Byron Nikolaidis Subject: Re: [INTERFACES] ODBC Driver v06-40-0005 Sam O'Connor wrote: > Hi, > I think I found another problem. > When selecting type text from tclodbc using pgodbc and postgres I was > loosing > one character off the start of the string for every newline in > contained. > When copy_and_conver_field processes selected text fields it converts cr > to cr/lf. (why?) > Actually, its LF to CR/LF when going from the database to odbc. When going the other way (odbc->database), it converts CR/LF to LF. The reason is for Microsoft from what I remember. It might have even been in the odbc spec (I can't quite remember). It probably shouldn't do it if its being run on Unix though? > When data_left is set how ever it uses the original length. > > I changed this: > stmt->bindings[stmt->current_col].data_left = strlen(value); > To this: > stmt->bindings[stmt->current_col].data_left = strlen(ptr); > > Now it works! > Good Job, you found a bug alright! It should be strlen(ptr). When I tested it, I didn't have newlines so it worked ok. I'll put it in for the next release. Byron --Boundary_(ID_03RHmtUNJX0uBsSCQl2gXg) Content-type: text/html; charset=US-ASCII Content-transfer-encoding: 7BIT

Hello,

 

I’m currently running version 07_03_0200 of the Insight Distribution Systems PostgreSQL Driver for windows.  when I retrieve col1 string from the database using:  “SELECT * FROM MyTable WHERE col1=’hello\n’”  the value returned for col1 through the driver is “hello\r\n”, and I want it to be as it is stored in the database (‘hello\n” with no \r).  Is this a configuration issue?  If so, where can I change the configuration to ensure that this conversion won’t happen? 

 

Thanx in advance for your help, amir

 

 

This is a mailing list thread I ran across that had the same problem.  I tried contacting Byron, but his email is no longer valid: 

 

Date: Fri, 09 Apr 1999 18:46:00 -0400
From: Byron Nikolaidis <byronn@insightdist.com>
Subject: Re: [INTERFACES] ODBC Driver v06-40-0005
 
Sam O'Connor wrote:
 
> Hi,
> I think I found another problem.
> When selecting type text from tclodbc using pgodbc and postgres I was
> loosing
> one character off the start of the string for every newline in
> contained.
> When copy_and_conver_field processes selected text fields it converts cr
> to cr/lf. (why?)
> 
 
Actually, its LF to CR/LF when going from the database to odbc.  When going the
other way (odbc->database), it converts CR/LF to LF.   The reason is for
Microsoft from what I remember.  It might have even been in the odbc spec (I
can't quite remember).   It probably shouldn't do it if its being run on Unix
though?
 
> When data_left is set how ever it uses the original length.
> 
> I changed this:
>         stmt->bindings[stmt->current_col].data_left = strlen(value);
> To this:
>         stmt->bindings[stmt->current_col].data_left = strlen(ptr);
> 
> Now it works!
> 
 
Good Job, you found a bug alright!   It should be strlen(ptr).  When I tested
it, I didn't have newlines so it worked ok.
 
I'll put it in for the next release.
 
Byron

 

 

--Boundary_(ID_03RHmtUNJX0uBsSCQl2gXg)--