Hi All,
Problem solved, though I don't know exactly what caused it.
I upgraded the operating system from SP3 to SP4, uninstalled all
superfluous software (although nothing I uninstalled seemed relevant),
reinstalled from scratch, and now it works. So there was some hidden
dodgy interaction between postgres on cygwin, and the operating system,
which caused postgres to give me invalid length messages.
Regards,
Jon