Re: DBD::Pg exorts char columns with trailing blanks

Поиск
Список
Период
Сортировка
От Adrian Klaver
Тема Re: DBD::Pg exorts char columns with trailing blanks
Дата
Msg-id 05e8c105-fa51-80bc-aa13-016aeb9455a6@aklaver.com
обсуждение исходный текст
Ответ на Re: DBD::Pg exorts char columns with trailing blanks  (Matthias Apitz <guru@unixarea.de>)
Ответы Re: DBD::Pg exorts char columns with trailing blanks  (Rob Sargent <robjsargent@gmail.com>)
Список pgsql-general
On 10/18/19 7:42 AM, Matthias Apitz wrote:
> El día viernes, octubre 18, 2019 a las 03:01:58p. m. +0200, Tom Lane escribió:
> 
>> Matthias Apitz <guru@unixarea.de> writes:
>>> When we export char columns with our Perl tools, they come out  with trailing blanks (in Sybase they don't). Can
thisbe suppressed?
 
>>
>> Switch to varchar, perhaps?
>>
>>             regards, tom lane
> 
> Sometimes people does not know, what they propose. We have a historical
> 25 years grown ILS which runs on top of Sybase, Oracle, Informix ... and
> should now be ported to PostgreSQL. We can't simple switch internal
> table structures and adopt some 10.000.000 lines of code (or debug while
> it is now crashing).

That was not mentioned in the original post. Anyway:

https://metacpan.org/pod/DBD::Pg#ChopBlanks-(boolean,-inherited)

https://metacpan.org/pod/DBI

"ChopBlanks

Type: boolean, inherited

The ChopBlanks attribute can be used to control the trimming of trailing 
space characters from fixed width character (CHAR) fields. No other 
field types are affected, even where field values have trailing spaces.

The default is false (although it is possible that the default may 
change). Applications that need specific behaviour should set the 
attribute as needed.

Drivers are not required to support this attribute, but any driver which 
does not support it must arrange to return undef as the attribute value."

> 
> Thanks anyway.
> 
>     matthias
> 
> 


-- 
Adrian Klaver
adrian.klaver@aklaver.com



В списке pgsql-general по дате отправления:

Предыдущее
От: Matthias Apitz
Дата:
Сообщение: Re: DBD::Pg exorts char columns with trailing blanks
Следующее
От: Rob Sargent
Дата:
Сообщение: Re: DBD::Pg exorts char columns with trailing blanks