Results 1 to 2 of 2

Thread: QSqlTableModel + PSQL is unable to find table (due to casing)

  1. #1
    Join Date
    Oct 2009
    Posts
    2
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default QSqlTableModel + PSQL is unable to find table (due to casing)

    Hi,

    I was using Qt 4.4.3 before and switched to 4.6.1. Now my tables are unable to load from Postgres. I figured out this is because the upper-case letters are being ignored when doing a select() or submitAll(). When I change all the table names to lower-case everything works fine. This problem doesn't occur with SQLite. In 4.4.3 it all worked fine. What changed? Is it possible to make it work with both lower and uppercase table names?

  2. #2
    Join Date
    Dec 2009
    Location
    Brisbane
    Posts
    17
    Thanked 3 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QSqlTableModel + PSQL is unable to find table (due to casing)

    What changed is the casing rules. We tried to be less proactive in figuring out what the programmer meant, and more "the programmer understands what he wants". In this case, postgresql is taking the lowercase as "ignore casing", so you got a bit lucky there (same with the old code). If you want to use exact casing, try placing quotes around the table name.

    The underlying problem is that different db engines have vastly different meanings for unquoted names and case sensitivity. Rather than continuously getting it wrong (and special casing all over the place), we simplified, and let the database do what it does with unquoted, and leave it to the programmer to get it right (quote it if you're really concerned with case sensitivity).

    Hope this helps.

Similar Threads

  1. unable to insert into mysql table
    By mohanakrishnan in forum Newbie
    Replies: 4
    Last Post: 5th December 2009, 06:02
  2. unable to insert into table
    By mohanakrishnan in forum Qt Programming
    Replies: 0
    Last Post: 4th December 2009, 11:52
  3. Find item in table
    By JohnToddSr in forum Qt Programming
    Replies: 1
    Last Post: 3rd July 2009, 17:24
  4. QSqlRelationalTableModel settable unable to find
    By nietzsche in forum Qt Programming
    Replies: 0
    Last Post: 25th May 2009, 23:51
  5. compile psql
    By raphaelf in forum Installation and Deployment
    Replies: 3
    Last Post: 27th May 2007, 01:26

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.