- // Shortcut boolean evaluation to optimize out call to
- // TablePrivileges
- //
- // Unfortunately this optimization doesn't seem to be
- // reliable!
- if (// *(pDb->dbInf.accessibleTables) == 'N' &&
- !pDb->TablePrivileges(tableName, wxT("SELECT"), pDb->GetUsername(), pDb->GetUsername(), tablePath))
+ bool hasPrivs wxDUMMY_INITIALIZE(true);
+
+ if (pDb->Dbms() == dbmsPOSTGRES)
+ hasPrivs = pDb->TablePrivileges(tableName, wxT("SELECT"), pDb->GetUsername(), NULL, tablePath);
+ else
+ hasPrivs = pDb->TablePrivileges(tableName, wxT("SELECT"), pDb->GetUsername(), pDb->GetUsername(), tablePath);
+
+ if (!hasPrivs)