Quote Originally Posted by Lesiok View Post
Sorry JohannesMunk but Yours solution is not working on PostgreSQL (and on another DB too I think). Before executing some query You must call QSqlDatabase::open() method. This method connecting to the real database not to the server.
There is always a real database called "postgresql" on each postgresql server. Maybe you don't have privileges to connect to it? And I'm not convinced you have to open any databases to be able to create other databases. Maybe that's a permission problem as well? Connecting to the server itself should be enough.