Skip to content

Commit

Permalink
Merge pull request #257 from duckdb/issue241
Browse files Browse the repository at this point in the history
Fix #241: quote FORMAT binary for old Postgres versions
  • Loading branch information
Mytherin authored Sep 3, 2024
2 parents ef26284 + 6fb9264 commit 8d3ba2a
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 8d3ba2a

Please sign in to comment.