,* for all\n");
- fprintf(stderr,"\t \\e [] -- edit the current query buffer or , \\E execute too\n");
+ fprintf(stderr,"\t \\e [] -- edit the current query buffer or ,\\E execute too\n");
fprintf(stderr,"\t \\f [] -- change field separater (currently '%s')\n", ps->opt.fieldSep);
fprintf(stderr,"\t \\g [] -- send query to backend [and place results in ]\n");
fprintf(stderr,"\t \\g | -- send query to backend and pipe results into \n");
while (!copydone) {
ret = PQgetline(res->conn, copybuf, COPYBUFSIZ);
- if (copybuf[0] == '.' && copybuf[1] =='\0') {
+ if (copybuf[0] == '\\' &&
+ copybuf[1] == '.' &&
+ copybuf[2] =='\0') {
copydone = true; /* don't print this... */
} else {
fputs(copybuf, stdout);
if (!quiet) {
fputs("Enter info followed by a newline\n", stdout);
- fputs("End with a dot on a line by itself.\n", stdout);
+ fputs("End with a backslash and a period on a line by itself.\n", stdout);
}
/*
}
if (c == EOF) {
/* reading from stdin, but from a file */
- PQputline(res->conn, ".");
+ PQputline(res->conn, "\\.");
copydone = true;
break;
}
*s = '\0';
PQputline(res->conn, copybuf);
if (firstload) {
- if (!strcmp(copybuf, ".")) {
+ if (!strcmp(copybuf, "\\.")) {
copydone = true;
}
firstload = false;