From: Jeff Eckermann <jeff_eckermann@yahoo.com>
To: Amir Zicherman <amir.zicherman@gmail.com>
To: pgsql-odbc@postgresql.org
Subject: Re: \n converted to \r\n
Date: Fri, 1 Oct 2004 06:56:47 -0700 (PDT)
Message-ID: <20041001135647.38646.qmail@web20825.mail.yahoo.com> (raw)
In-Reply-To: <27a5b7d1040930123958a1afeb@mail.gmail.com>
--- Amir Zicherman <amir.zicherman@gmail.com> wrote:
> 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?
I don't believe that there is any user-settable option
to disable that functionality. The driver assumes
that the returned value will (or may) be required for
display, so on Windows, \r\n is the appropriate
combination. No doubt this makes sense 99.9% of the
time.
Perhaps if you could tell us what it is that you are
trying to do, someone on the list can suggest a
workaround that will do the job for you.
>
> Thanx in advance for your help, amir
>
>
>
> PS: This is a mailing list thread I ran across that
> had the same
> problem. does anybody know if the bug has been
> fixed? 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
>
> ---------------------------(end of
> broadcast)---------------------------
> TIP 4: Don't 'kill -9' the postmaster
>
_______________________________
Do you Yahoo!?
Declare Yourself - Register online to vote today!
http://vote.yahoo.com
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-odbc@postgresql.org
Cc: jeff_eckermann@yahoo.com, amir.zicherman@gmail.com
Subject: Re: \n converted to \r\n
In-Reply-To: <20041001135647.38646.qmail@web20825.mail.yahoo.com>
References: <27a5b7d1040930123958a1afeb@mail.gmail.com> <20041001135647.38646.qmail@web20825.mail.yahoo.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