De acuerdo con el fragmento de código de la fuente de PostgreSQL, copy.c :
/* Process \n */
if (c == '\n' && (!cstate->csv_mode || !in_quote))
{
if (cstate->eol_type == EOL_CR || cstate->eol_type == EOL_CRNL)
ereport(ERROR,
(errcode(ERRCODE_BAD_COPY_FILE_FORMAT),
!cstate->csv_mode ?
errmsg("literal newline found in data") :
errmsg("unquoted newline found in data"),
!cstate->csv_mode ?
errhint("Use \"\\n\" to represent newline.") :
errhint("Use quoted CSV field to represent newline.")));
cstate->eol_type = EOL_NL; /* in case not set yet */
/* If reach here, we have found the line terminator */
break;
}
significa que sus datos de entrada están usando el byte 0x0A en algún lugar dentro de sus cuerdas, p. usas "abcNxyz" , donde en lugar de N en realidad hay byte con valor 0x0A .
La solución es usar la cadena "abc\n" en su lugar. Debería poder encontrar todas las nuevas líneas falsas y reemplazarlas por \n usando algún script, tal vez Python o Perl.