Skip to content

Commit

Permalink
Fix #241: quote FORMAT binary for old Postgres versions
Browse files Browse the repository at this point in the history
  • Loading branch information
Mytherin committed Sep 3, 2024
1 parent b6dda6c commit 6fb9264
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/postgres_scanner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -231,14 +231,14 @@ static void PostgresInitInternal(ClientContext &context, const PostgresBindData
D_ASSERT(!bind_data->sql.empty());
lstate.sql = StringUtil::Format(
R"(
COPY (SELECT %s FROM (%s) AS __unnamed_subquery %s) TO STDOUT (FORMAT binary);
COPY (SELECT %s FROM (%s) AS __unnamed_subquery %s) TO STDOUT (FORMAT "binary");
)",
col_names, bind_data->sql, filter);

} else {
lstate.sql = StringUtil::Format(
R"(
COPY (SELECT %s FROM %s.%s %s) TO STDOUT (FORMAT binary);
COPY (SELECT %s FROM %s.%s %s) TO STDOUT (FORMAT "binary");
)",
col_names, KeywordHelper::WriteQuoted(bind_data->schema_name, '"'),
KeywordHelper::WriteQuoted(bind_data->table_name, '"'), filter);
Expand Down

0 comments on commit 6fb9264

Please sign in to comment.