Skip site navigation (1) Skip section navigation (2)

[ psqlodbc-Bugs-1010516 ] Carriage return added to Line Feed on conversion from SQL_LONGVARCHAR to text

From: <noreply(at)pgfoundry(dot)org>
To: noreply(at)pgfoundry(dot)org
Subject: [ psqlodbc-Bugs-1010516 ] Carriage return added to Line Feed on conversion from SQL_LONGVARCHAR to text
Date: 2008-12-04 02:42:37
Message-ID: 20081204024237.D01A817ADE55@pgfoundry.org (view raw or flat)
Thread:
Lists: pgsql-odbc
Bugs item #1010516, was opened at 2008-11-29 17:15
You can respond by visiting: 
http://pgfoundry.org/tracker/?func=detail&atid=538&aid=1010516&group_id=1000125

Category: Interface (example)
Group: None
Status: Open
Resolution: None
Priority: 3
Submitted By: Farid Zidan (faridz)
Assigned to: Hiroshi Inoue (hinoue)
Summary: Carriage return added to Line Feed on conversion from SQL_LONGVARCHAR to text

Initial Comment:
ODBC driver PostgreSQL ANSI 8.03.04.00
Windows XP SP3
Database Encoding WIN1252
Server PostgreSQL 8.3.5

Using bind parameters, column is bound as SQL_LONGVARCHAR. Driver is adding a carriage return character to each line feed character it finds in the insert statement parameters.

create table test_query (
rs_oid               INT4                 not null,
query_text           TEXT                 not null,
constraint PK_TEST_QUERY primary key (rs_oid)

Source string:
select¶* ¶from¶test

Inserted string:
select§¶* §¶from§¶drg 

where 
Carriage Return is '§'
Line Feed '¶'


----------------------------------------------------------------------

>Comment By: Farid Zidan (faridz)
Date: 2008-12-03 21:42

Message:
I did not know I needed to do that. When I store a string in
a text column in the database, I assume the database is
going to store it exactly as I send it to the database and
preserve all the characters of the string. If there an
option to convert LF -> CR/LF this option must not be
enabled by default. I save "hello<LF>world" to the database,
I expect I will have "hello<LF>world" stored in the database
and not something else.

This works in all the databases I use: Firebird, MS SQL
Server, Oracle, DB2, Sybase. They all do not do any behind
the scene conversions of LF -> CR/LF for text columns and I
would so expect PostgreSQL by default. The option of
converting LF -> CR/LF may be helpful for some situations
but should not be the default behavior.

I would change this bug report to have this option disabled
by default so that that the database stores text exactly as
the user send them.

Regards,
Farid


----------------------------------------------------------------------

Comment By: Hiroshi Inoue (hinoue)
Date: 2008-12-03 18:55

Message:
Did you try to turn off LF <-> CR/LF convesion option ?

----------------------------------------------------------------------

You can respond by visiting: 
http://pgfoundry.org/tracker/?func=detail&atid=538&aid=1010516&group_id=1000125

pgsql-odbc by date

Next:From: noreplyDate: 2008-12-04 22:12:02
Subject: [ psqlodbc-Bugs-1010522 ] BIGINT colums returns bad values
Previous:From: noreplyDate: 2008-12-04 00:04:42
Subject: [ psqlodbc-Bugs-1010515 ] Small negative decimal values are mistaken for non-negative

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group