On 2015-04-06 10:23 , Michael Paquier Wrote: And this test expects that result of column "name" does not contain more 10k characters, so your data set is incompatible with your test, explaining the crash you are seeing. -- Michael --------------- Thanks for your answer,but i still can not understand why here is "varcharsize * offset >= size", while in the non binary branch that is "varcharsize >= size" and works fine on the same test case(truncate size to varcharsize). binary.pgc: ---------------------- EXEC SQL DECLARE B BINARY CURSOR FOR select name from empl where idnum =:empl.idnum; ==>(the non binary branch works fine) EXEC SQL DECLARE B CURSOR FOR select name from empl where idnum =:empl.idnum; src/interfaces/ecpg/ecpglib/data.c:466 if (binary) { if (varcharsize == 0 || varcharsize * offset >= size) memcpy(var + offset * act_tuple, pval, size);//!!! memory overflow for BINARY CURSOR !!! else { memcpy(var + offset * act_tuple, pval, varcharsize * offset); ... } ... } else { ... if (varcharsize == 0 || varcharsize > size) { strncpy(str, pval, size + 1); ... } else { strncpy(str, pval, varcharsize);//!!! truncate size to varcharsize for NON BINARY CURSOR !!! ... } ... -- Regards, Chen Huajun