remote_db.setHostName(remote_addr); remote_db.setPassword(pass); remote_db.setUserName(login); remote_db.setDatabaseName("mydb"); remote_db.setPort(5432); remote_db.setConnectOptions("connect_timeout=5;"); if (remote_db.open()) { remote_query = new QSqlQuery(remote_db); //таблица типов помещений if (!remote_query -> exec("CREATE TABLE LocationList (loc_number SERIAL, location VARCHAR(50));")) { write_log(remote_query -> lastError().text()); } }