Fix error in termination of COPY IN mode when using V2 protocol.
authorTom Lane <[email protected]>
Sun, 14 Mar 2004 22:01:01 +0000 (22:01 +0000)
committerTom Lane <[email protected]>
Sun, 14 Mar 2004 22:01:01 +0000 (22:01 +0000)
Report and fix per ljb, 8-Mar-04.

src/interfaces/libpq/fe-exec.c

index 5a6d651bcd45f4ef425bd856d7bae5b05b854c08..b988e37661ea939d6a2561bf9c1165cdb4cd2ecf 100644 (file)
@@ -1469,7 +1469,7 @@ PQputCopyEnd(PGconn *conn, const char *errormsg)
                {
                        /* Send old-style end-of-data marker */
                        if (pqPutMsgStart(0, false, conn) < 0 ||
-                               pqPuts("\\.\n", conn) < 0 ||
+                               pqPutnchar("\\.\n", 3, conn) < 0 ||
                                pqPutMsgEnd(conn) < 0)
                                return -1;
                }