diff --git a/src/Storages/PostgreSQL/PostgreSQLConnectionPool.cpp b/src/Storages/PostgreSQL/PostgreSQLConnectionPool.cpp index 86b0a1ae5e5..68c0e22f83c 100644 --- a/src/Storages/PostgreSQL/PostgreSQLConnectionPool.cpp +++ b/src/Storages/PostgreSQL/PostgreSQLConnectionPool.cpp @@ -19,7 +19,6 @@ PostgreSQLConnectionPool::PostgreSQLConnectionPool( { address = host + ':' + std::to_string(port); connection_str = formatConnectionString(std::move(dbname), std::move(host), port, std::move(user), std::move(password)); - initialize(); } @@ -28,7 +27,6 @@ PostgreSQLConnectionPool::PostgreSQLConnectionPool(const PostgreSQLConnectionPoo , connection_str(other.connection_str) , address(other.address) { - initialize(); } @@ -45,14 +43,6 @@ std::string PostgreSQLConnectionPool::formatConnectionString( } -void PostgreSQLConnectionPool::initialize() -{ - /// No connection is made, just fill pool with non-connected connection objects. - for (size_t i = 0; i < POSTGRESQL_POOL_DEFAULT_SIZE; ++i) - pool->push(std::make_shared(connection_str, address)); -} - - PostgreSQLConnectionHolderPtr PostgreSQLConnectionPool::get() { PostgreSQLConnectionPtr connection; diff --git a/src/Storages/PostgreSQL/PostgreSQLConnectionPool.h b/src/Storages/PostgreSQL/PostgreSQLConnectionPool.h index 3922cde7c04..c07eb936a3c 100644 --- a/src/Storages/PostgreSQL/PostgreSQLConnectionPool.h +++ b/src/Storages/PostgreSQL/PostgreSQLConnectionPool.h @@ -41,8 +41,6 @@ private: static std::string formatConnectionString( std::string dbname, std::string host, UInt16 port, std::string user, std::string password); - void initialize(); - PoolPtr pool; std::string connection_str, address; };