Update fetchPostgreSQLTableStructure.cpp

This commit is contained in:
Kseniia Sumarokova 2022-07-17 11:55:34 +02:00 committed by GitHub
parent 9bba55110c
commit 4b11a718cb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -40,7 +40,7 @@ std::set<String> fetchPostgreSQLTablesList(T & tx, const String & postgres_schem
if (schemas.size() <= 1) if (schemas.size() <= 1)
{ {
std::string query = fmt::format( std::string query = fmt::format(
"SELECT tablename FROM pg_catalog.pg_tables WHERE schemaname != 'pg_catalog' AND schemaname = {}", "SELECT tablename FROM pg_catalog.pg_tables WHERE schemaname = {}",
postgres_schema.empty() ? quoteString("public") : quoteString(postgres_schema)); postgres_schema.empty() ? quoteString("public") : quoteString(postgres_schema));
for (auto table_name : tx.template stream<std::string>(query)) for (auto table_name : tx.template stream<std::string>(query))
@ -55,7 +55,7 @@ std::set<String> fetchPostgreSQLTablesList(T & tx, const String & postgres_schem
for (const auto & schema : schemas) for (const auto & schema : schemas)
{ {
std::string query = fmt::format( std::string query = fmt::format(
"SELECT tablename FROM pg_catalog.pg_tables WHERE schemaname != 'pg_catalog' AND schemaname = {}", "SELECT tablename FROM pg_catalog.pg_tables WHERE schemaname = {}",
quoteString(schema)); quoteString(schema));
for (auto table_name : tx.template stream<std::string>(query)) for (auto table_name : tx.template stream<std::string>(query))