From 6fb926453486f176fa8c5306e820979fb444f626 Mon Sep 17 00:00:00 2001 From: Mark Raasveldt Date: Tue, 3 Sep 2024 20:02:50 +0200 Subject: [PATCH] Fix #241: quote FORMAT binary for old Postgres versions --- src/postgres_scanner.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/postgres_scanner.cpp b/src/postgres_scanner.cpp index 0c82233..2e5f2b4 100644 --- a/src/postgres_scanner.cpp +++ b/src/postgres_scanner.cpp @@ -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);