Concat truncates at 257 characters
От | Patrick Lademan |
---|---|
Тема | Concat truncates at 257 characters |
Дата | |
Msg-id | CADMm_6AakPuWNbRLKvj6LjkdSyc7r=NKLd5Q0x36itCMRp2phA@mail.gmail.com обсуждение исходный текст |
Ответы |
Re: Concat truncates at 257 characters
Re: Concat truncates at 257 characters |
Список | pgsql-bugs |
Hello, My automated database unit tests compare the actual result to the expected result then provides a pass or fail status. When it fails, it constructs a difference string with an ^ pointing to each mismatching character between the two. Some of my tests have very long strings of data used to validate that a function is working correctly under very specific test conditions. The problem is that the concat and || are truncating the result. The following simple examples all truncate at 257 characters and add a trailing " (...)". select rpad('', 200, 'A') || rpad('', 200, 'B'); select rpad('', 200, 'A')::text || rpad('', 200, 'B')::text; select cast( rpad('', 200, 'A')::text || rpad('', 200, 'B')::text as text ); select cast( rpad('', 200, 'A') as text ) || cast( rpad('', 200, 'B') as text ); select cast( cast( rpad('', 200, 'A') as text ) || cast( rpad('', 200, 'B') as text ) as text); select concat( rpad('', 200, 'A'), rpad('', 200, 'B') ); select concat( rpad('', 200, 'A')::varchar(4000) , rpad('', 200, 'B')::varchar(4000) )::varchar(4000); select concat( rpad('', 200, 'A')::text , rpad('', 200, 'B')::text )::text; Database: "PostgreSQL 9.3.1 on x86_64-apple-darwin, compiled by i686-apple-darwin11-llvm-gcc-4.2 (GCC) 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.9.00), 64-bit" Mac: System Version: OS X 10.9 (13A603) Kernel Version: Darwin 13.0.0 How can I extend the concat beyond 257? Thank you, Pat
В списке pgsql-bugs по дате отправления: