Skip to content

Commit

Permalink
Use copy with binary.
Browse files Browse the repository at this point in the history
  • Loading branch information
VaibhaveS committed Jul 31, 2024
1 parent 792c554 commit e726e1f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/bin/pgcopydb/pgsql.c
Original file line number Diff line number Diff line change
Expand Up @@ -2929,7 +2929,7 @@ pg_copy_from_stdin(PGSQL *pgsql, const char *qname)
{
char sql[BUFSIZE] = { 0 };

sformat(sql, sizeof(sql), "COPY %s FROM stdin", qname);
sformat(sql, sizeof(sql), "COPY %s FROM stdin WITH (format binary)", qname);

char *endpoint =
pgsql->connectionType == PGSQL_CONN_SOURCE ? "SOURCE" : "TARGET";
Expand Down Expand Up @@ -3073,7 +3073,7 @@ pg_copy_send_query(PGSQL *pgsql, CopyArgs *args, ExecStatusType status)
args->srcAttrList,
args->srcQname);
}
appendPQExpBuffer(sql, "to stdout");
appendPQExpBuffer(sql, "to stdout with (format binary);");
}
else if (status == PGRES_COPY_IN)
{
Expand All @@ -3090,7 +3090,7 @@ pg_copy_send_query(PGSQL *pgsql, CopyArgs *args, ExecStatusType status)

if (args->freeze)
{
appendPQExpBuffer(sql, " with (freeze)");
appendPQExpBuffer(sql, " with (freeze, format binary)");
}
}
else
Expand Down

0 comments on commit e726e1f

Please sign in to comment.