1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-08 11:42:09 +03:00

Review uses of IsUnderPostmaster, change some tests to look at

whereToSendOutput instead because they are really inquiring about
the correct client communication protocol.  Update some comments.
This is pointing towards supporting regular FE/BE client protocol
in a standalone backend, per discussion a month or so back.
This commit is contained in:
Tom Lane
2004-01-28 21:02:40 +00:00
parent b3ead7c045
commit 2f0d43b251
8 changed files with 51 additions and 26 deletions

View File

@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/commands/copy.c,v 1.216 2004/01/26 22:35:31 tgl Exp $
* $PostgreSQL: pgsql/src/backend/commands/copy.c,v 1.217 2004/01/28 21:02:39 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@ -829,7 +829,7 @@ DoCopy(const CopyStmt *stmt)
}
if (pipe)
{
if (IsUnderPostmaster)
if (whereToSendOutput == Remote)
ReceiveCopyBegin(binary, length(attnumlist));
else
copy_file = stdin;
@ -879,7 +879,7 @@ DoCopy(const CopyStmt *stmt)
}
if (pipe)
{
if (IsUnderPostmaster)
if (whereToSendOutput == Remote)
SendCopyBegin(binary, length(attnumlist));
else
copy_file = stdout;
@ -929,7 +929,7 @@ DoCopy(const CopyStmt *stmt)
errmsg("could not write to file \"%s\": %m",
filename)));
}
else if (IsUnderPostmaster && !is_from)
else if (whereToSendOutput == Remote && !is_from)
SendCopyEnd(binary);
pfree(attribute_buf.data);
pfree(line_buf.data);