Skip to content

Commit

Permalink
Merge pull request #49481 from snikch/master
Browse files Browse the repository at this point in the history
Fix postgres database setting
  • Loading branch information
kssenii committed May 5, 2023
2 parents c87a6e8 + 5727585 commit 7c203db
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
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

0 comments on commit 7c203db

Please sign in to comment.