Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix postgres database setting #49481

Merged
merged 1 commit into from
May 5, 2023
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/Databases/DatabaseFactory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ DatabasePtr DatabaseFactory::getImpl(const ASTCreateQuery & create, const String
if (auto named_collection = tryGetNamedCollectionWithOverrides(engine_args, context))
{
configuration = StoragePostgreSQL::processNamedCollectionResult(*named_collection, false);
use_table_cache = named_collection->getOrDefault<UInt64>("use_tables_cache", 0);
use_table_cache = named_collection->getOrDefault<UInt64>("use_table_cache", 0);
}
else
{
Expand Down
2 changes: 1 addition & 1 deletion src/Storages/StoragePostgreSQL.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -416,7 +416,7 @@ StoragePostgreSQL::Configuration StoragePostgreSQL::processNamedCollectionResult
required_arguments.insert("table");

validateNamedCollection<ValidateKeysMultiset<ExternalDatabaseEqualKeysSet>>(
named_collection, required_arguments, {"schema", "on_conflict", "addresses_expr", "host", "hostname", "port", "use_tables_cache"});
named_collection, required_arguments, {"schema", "on_conflict", "addresses_expr", "host", "hostname", "port", "use_table_cache"});

configuration.addresses_expr = named_collection.getOrDefault<String>("addresses_expr", "");
if (configuration.addresses_expr.empty())
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/test_postgresql_database_engine/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@ def test_predefined_connection_configuration(started_cluster):
node1.query(
"""
DROP DATABASE postgres_database;
CREATE DATABASE postgres_database ENGINE = PostgreSQL(postgres1, use_tables_cache=1);
CREATE DATABASE postgres_database ENGINE = PostgreSQL(postgres1, use_table_cache=1);
"""
)
assert (
Expand Down