Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/MainDistributionPipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
name: Build extension binaries
uses: duckdb/extension-ci-tools/.github/workflows/_extension_distribution.yml@main
with:
duckdb_version: dfd87550849406b1823812222ef92525724780d3
duckdb_version: 326202015f4e5ed031c898ab1bc0860cd614cac1
ci_tools_version: main
extension_name: postgres_scanner
exclude_archs: 'wasm_mvp;wasm_eh;wasm_threads;windows_amd64_mingw'
Expand All @@ -27,7 +27,7 @@ jobs:
uses: duckdb/extension-ci-tools/.github/workflows/_extension_deploy.yml@main
secrets: inherit
with:
duckdb_version: dfd87550849406b1823812222ef92525724780d3
duckdb_version: 326202015f4e5ed031c898ab1bc0860cd614cac1
ci_tools_version: main
extension_name: postgres_scanner
exclude_archs: 'wasm_mvp;wasm_eh;wasm_threads;windows_amd64_mingw'
Expand Down
2 changes: 1 addition & 1 deletion duckdb
Submodule duckdb updated 3880 files
14 changes: 7 additions & 7 deletions scripts/win_resources.patch
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 24afa3db42..d3f04aed2d 100644
index 9dd2ea45d2..a583df2d9a 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -130,7 +130,6 @@ if(WIN32 AND NOT MINGW)
@@ -132,7 +132,6 @@ if(WIN32 AND NOT MINGW)
set(CMAKE_RC_FLAGS
"${CMAKE_RC_FLAGS} -D DUCKDB_DEV_ITERATION=\"${RC_DEV_ITERATION}\"")

Expand All @@ -11,14 +11,14 @@ index 24afa3db42..d3f04aed2d 100644

install(
diff --git a/tools/shell/CMakeLists.txt b/tools/shell/CMakeLists.txt
index 0d26359008..04c5c7f01f 100644
index 7c376be703..956a2df514 100644
--- a/tools/shell/CMakeLists.txt
+++ b/tools/shell/CMakeLists.txt
@@ -77,7 +77,6 @@ if(WIN32 AND NOT MINGW)
@@ -74,7 +74,6 @@ if(WIN32 AND NOT MINGW)
"${CMAKE_RC_FLAGS} -D DUCKDB_DEV_ITERATION=\"${RC_DEV_ITERATION}\"")
set(CMAKE_RC_FLAGS
"${CMAKE_RC_FLAGS} -D DUCKDB_COPYRIGHT_YEAR=\"${DUCKDB_COPYRIGHT_YEAR}\"")
- target_sources(shell PRIVATE rc/duckdb.rc)
endif()

set_target_properties(shell PROPERTIES OUTPUT_NAME duckdb)
# Opt into the Windows Segment Heap to avoid the default NT heap's lock
# contention under multi-threaded allocation (see #24027). CMake merges
# .manifest sources into the linker manifest via mt.exe.
4 changes: 2 additions & 2 deletions src/include/storage/postgres_catalog.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ class PostgresCatalog : public Catalog {
string GetCatalogType() override {
return "postgres";
}
string GetDefaultSchema() const override {
Identifier GetDefaultSchema() const override {
return default_schema.empty() ? "public" : default_schema;
}

Expand Down Expand Up @@ -147,7 +147,7 @@ class PostgresCatalog : public Catalog {
PostgresVersion version;
PostgresSchemaSet schemas;
shared_ptr<PostgresConnectionPool> connection_pool;
string default_schema;
Identifier default_schema;
SecretStorageTable secret_storage_table;
//! Overrides what the shell prompt displays for this catalog - see GetConnectDisplay
string connect_display;
Expand Down
2 changes: 1 addition & 1 deletion src/postgres_attach.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ struct AttachFunctionData : public TableFunctionData {
};

static unique_ptr<FunctionData> AttachBind(ClientContext &context, TableFunctionBindInput &input,
vector<LogicalType> &return_types, vector<string> &names) {
vector<LogicalType> &return_types, vector<Identifier> &names) {
auto result = make_uniq<AttachFunctionData>();
result->dsn = input.inputs[0].GetValue<string>();

Expand Down
6 changes: 3 additions & 3 deletions src/postgres_binary_copy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ static void PostgresBinaryReadScan(ClientContext &context, TableFunctionInput &d
}

static unique_ptr<FunctionData> ReadPostgresBinaryBind(ClientContext &context, TableFunctionBindInput &input,
vector<LogicalType> &return_types, vector<string> &names) {
vector<LogicalType> &return_types, vector<Identifier> &names) {
auto result = make_uniq<PostgresBinaryReadBindData>();
result->file_path = input.inputs[0].GetValue<string>();

Expand All @@ -173,12 +173,12 @@ static unique_ptr<FunctionData> ReadPostgresBinaryBind(ClientContext &context, T
auto col_type_str = column_map[i].GetValue<string>();
auto col_type = TransformStringToLogicalType(col_type_str, context);

names.push_back(col_name.GetIdentifierName());
names.push_back(col_name);
return_types.push_back(col_type);
result->postgres_types.push_back(PostgresUtils::CreateEmptyPostgresType(col_type));
}

result->names = names;
result->names = IdentifiersToStrings(names);
result->types = return_types;

if (input.named_parameters.count("buffer_size")) {
Expand Down
2 changes: 2 additions & 0 deletions src/postgres_hstore.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -216,10 +216,12 @@ void PostgresHstoreToJsonFun(DataChunk &args, ExpressionState &state, Vector &re
void RegisterHstoreFunctions(ExtensionLoader &loader) {
auto hstore_get = ScalarFunction("postgres_hstore_get", {LogicalType::VARCHAR, LogicalType::VARCHAR},
LogicalType::VARCHAR, PostgresHstoreGetFun);
hstore_get.SetFallible();
loader.RegisterFunction(hstore_get);

auto hstore_to_json =
ScalarFunction("postgres_hstore_to_json", {LogicalType::VARCHAR}, LogicalType::JSON(), PostgresHstoreToJsonFun);
hstore_to_json.SetFallible();
loader.RegisterFunction(hstore_to_json);
}

Expand Down
10 changes: 6 additions & 4 deletions src/postgres_query.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ static bool ExtractFlag(TableFunctionBindInput &input, const string &name, bool
}

static unique_ptr<FunctionData> PGQueryBind(ClientContext &context, TableFunctionBindInput &input,
vector<LogicalType> &return_types, vector<string> &names) {
vector<LogicalType> &return_types, vector<Identifier> &names) {
auto result = make_uniq<PostgresBindData>(context);

if (input.inputs[0].IsNull() || input.inputs[1].IsNull()) {
Expand Down Expand Up @@ -99,11 +99,11 @@ static unique_ptr<FunctionData> PGQueryBind(ClientContext &context, TableFunctio
input.table_function.call_return_type = StatementReturnType::NOTHING;
}
return_types.emplace_back(LogicalType::BIGINT);
names.emplace_back("rowcount");
names.emplace_back(Identifier("rowcount"));
result->SetCatalog(pg_catalog);
result->dsn = con.GetDSN();
result->types = return_types;
result->names = names;
result->names.emplace_back(names[0].GetIdentifierName());
result->read_only = false;
result->sql = std::move(sql);
result->use_transaction = use_transaction;
Expand Down Expand Up @@ -136,7 +136,9 @@ static unique_ptr<FunctionData> PGQueryBind(ClientContext &context, TableFunctio
result->SetCatalog(pg_catalog);
result->dsn = con.GetDSN();
result->types = return_types;
result->names = names;
for (auto &nm : names) {
result->names.emplace_back(nm.GetIdentifierName());
}
result->read_only = false;
result->sql = std::move(sql);
result->params = PostgresParameters(std::move(param_types), std::move(param_values));
Expand Down
4 changes: 2 additions & 2 deletions src/postgres_scanner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ void PostgresBindData::SetTable(PostgresTableEntry &table) {
}

static unique_ptr<FunctionData> PostgresBind(ClientContext &context, TableFunctionBindInput &input,
vector<LogicalType> &return_types, vector<string> &names) {
vector<LogicalType> &return_types, vector<Identifier> &names) {
auto bind_data = make_uniq<PostgresBindData>(context);

bind_data->dsn = input.inputs[0].GetValue<string>();
Expand All @@ -186,7 +186,7 @@ static unique_ptr<FunctionData> PostgresBind(ClientContext &context, TableFuncti

bind_data->postgres_types = info->postgres_types;
for (auto &col : info->create_info->columns.Logical()) {
names.push_back(col.GetName().GetIdentifierName());
names.push_back(col.GetName());
return_types.push_back(col.GetType());
}
bind_data->names = info->postgres_names;
Expand Down
4 changes: 1 addition & 3 deletions src/postgres_utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -371,9 +371,7 @@ LogicalType PostgresUtils::ToPostgresType(const LogicalType &input) {
auto &type = StructType::GetChildType(input, c);
new_types.push_back(make_pair(name, ToPostgresType(type)));
}
auto result = LogicalType::STRUCT(std::move(new_types));
result.SetAlias(input.GetAlias());
return result;
return LogicalType::STRUCT(std::move(new_types)).WithAlias(input.GetAlias());
}
case LogicalTypeId::TIMESTAMP_SEC:
case LogicalTypeId::TIMESTAMP_MS:
Expand Down
2 changes: 1 addition & 1 deletion src/storage/postgres_catalog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ PostgresCatalog::PostgresCatalog(ClientContext &ctx, AttachedDatabase &db_p, str
: Catalog(db_p), attach_path(std::move(attach_path_p)), access_mode(access_mode), isolation_level(isolation_level),
text_protocol_mode(text_protocol_mode), schemas(*this, schemas_to_load),
connection_pool(make_shared_ptr<PostgresConnectionPool>(*this, ctx)),
default_schema(schemas_to_load.size() > 0 ? schemas_to_load[0] : std::string()),
default_schema(schemas_to_load.size() > 0 ? Identifier(schemas_to_load[0]) : Identifier()),
secret_storage_table(std::move(secret_storage_table_p)), connect_display(std::move(connect_display_p)) {
auto secret_entry = GetSecretEntry(ctx, secret_name);
this->rds_token_config = PostgresAws::ExtractTokenConfigFromSecret(secret_entry);
Expand Down
2 changes: 1 addition & 1 deletion src/storage/postgres_clear_cache.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ struct ClearCacheFunctionData : public TableFunctionData {
};

static unique_ptr<FunctionData> ClearCacheBind(ClientContext &context, TableFunctionBindInput &input,
vector<LogicalType> &return_types, vector<string> &names) {
vector<LogicalType> &return_types, vector<Identifier> &names) {
auto result = make_uniq<ClearCacheFunctionData>();
return_types.push_back(LogicalType::BOOLEAN);
names.emplace_back("Success");
Expand Down
8 changes: 3 additions & 5 deletions src/storage/postgres_type_set.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,7 @@ void PostgresTypeSet::CreateEnum(PostgresTransaction &transaction, PostgresResul
for (idx_t enum_idx = 0; enum_idx < enum_count; enum_idx++) {
duckdb_levels.SetValue(enum_idx, result.GetString(start_row + enum_idx, 3));
}
info.type = LogicalType::ENUM(duckdb_levels, enum_count);
info.type.SetAlias(info.GetTypeName().GetIdentifierName());
info.type = LogicalType::ENUM(duckdb_levels, enum_count).WithAlias(info.GetTypeName().GetIdentifierName());
auto type_entry = make_shared_ptr<PostgresTypeEntry>(catalog, schema, info, postgres_type);
CreateEntry(transaction, std::move(type_entry));
}
Expand Down Expand Up @@ -128,8 +127,7 @@ void PostgresTypeSet::CreateCompositeType(PostgresTransaction &transaction, Post
Identifier(type_name), PostgresUtils::TypeToLogicalType(&transaction, &schema, type_data, child_type)));
postgres_type.children.push_back(std::move(child_type));
}
info.type = LogicalType::STRUCT(std::move(child_types));
info.type.SetAlias(info.GetTypeName().GetIdentifierName());
info.type = LogicalType::STRUCT(std::move(child_types)).WithAlias(info.GetTypeName().GetIdentifierName());
auto type_entry = make_shared_ptr<PostgresTypeEntry>(catalog, schema, info, postgres_type);
CreateEntry(transaction, std::move(type_entry));
}
Expand Down Expand Up @@ -207,7 +205,7 @@ optional_ptr<CatalogEntry> PostgresTypeSet::CreateType(PostgresTransaction &tran

auto create_sql = GetCreateTypeSQL(info);
conn.Execute(transaction.GetContext(), create_sql);
info.type.SetAlias(info.GetTypeName().GetIdentifierName());
info.type = info.type.WithAlias(info.GetTypeName().GetIdentifierName());
auto pg_type = PostgresUtils::CreateEmptyPostgresType(info.type);
auto type_entry = make_shared_ptr<PostgresTypeEntry>(catalog, schema, info, pg_type);
return CreateEntry(transaction, std::move(type_entry));
Expand Down
Loading