While reading copy.c I noticed this line:
#define RAW_BUF_SIZE 65536 /* we palloc RAW_BUF_SIZE+1 bytes */ Doesn't that seem rather odd? If we're adding 1 wouldn't it be better as 65535 so we palloc a power of 2? I have no idea if this affects performance, but it did strike me as strange. cheers andrew -- Andrew Dunstan https://www.2ndQuadrant.com PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services