Kjetil Haaland <kjetil(dot)haaland(at)student(dot)uib(dot)no> writes:
> first = palloc(sizeof(char)*secondStart);
> elog(NOTICE, "2:first=%s", first);
> elog(NOTICE, "strlen(first)=%d", strlen(first));
This is bogus because you've only allocated space, not filled it with
anything. It will contain whatever that RAM was last used for.
regards, tom lane