Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

[SOLVED]QSqlTableModel - table name issue in Postresql



  • Hi All,

    Recently I noticed that I've to add double quotes to table's name for calling Postgresql's table while it's not required for MySQL or SQLite tables!!

    how can I make QSqlTableModel works in same way for three types of SQL databases?

    Posgtresql:
    @p_tableModel->setTable(""Persons"");@

    MySQL & SQLite:
    @p_tableModel->setTable("Persons");@



  • Table's name became case sensitive in Postgres so if any one hates to use double quotes in table's name he/she has to use small letters for all the name in the database.


Log in to reply