mirror of
https://github.com/postgres/postgres.git
synced 2025-07-08 11:42:09 +03:00
Add pipe parameter to COPY function to allow proper line termination.
This commit is contained in:
@ -8,7 +8,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/commands/copy.c,v 1.192 2003/04/19 00:02:29 tgl Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/commands/copy.c,v 1.193 2003/04/19 19:55:37 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -114,7 +114,7 @@ static int server_encoding;
|
||||
*/
|
||||
static void SendCopyBegin(bool binary);
|
||||
static void ReceiveCopyBegin(bool binary);
|
||||
static void SendCopyEnd(bool binary);
|
||||
static void SendCopyEnd(bool binary, bool pipe);
|
||||
static void CopySendData(void *databuf, int datasize);
|
||||
static void CopySendString(const char *str);
|
||||
static void CopySendChar(char c);
|
||||
@ -178,7 +178,7 @@ ReceiveCopyBegin(bool binary)
|
||||
}
|
||||
|
||||
static void
|
||||
SendCopyEnd(bool binary)
|
||||
SendCopyEnd(bool binary, bool pipe)
|
||||
{
|
||||
if (!binary)
|
||||
CopySendData("\\.\n", 3);
|
||||
@ -680,7 +680,7 @@ DoCopy(const CopyStmt *stmt)
|
||||
if (!pipe)
|
||||
FreeFile(copy_file);
|
||||
else if (IsUnderPostmaster && !is_from)
|
||||
SendCopyEnd(binary);
|
||||
SendCopyEnd(binary, pipe);
|
||||
pfree(attribute_buf.data);
|
||||
|
||||
/*
|
||||
|
Reference in New Issue
Block a user