Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-79332

QSqlTableModel.setTable() fails with PostgreSQL 12

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Not Evaluated
    • Resolution: Duplicate
    • Affects Version/s: 5.13.1
    • Fix Version/s: 5.14
    • Component/s: SQL Support
    • Labels:
      None
    • Environment:
      ArchLinux, PyQt5 5.13.1
    • Platform/s:
      Linux/X11

      Description

      I don't know if this is a duplicate of QTBUG-79033 or not, but setTable() comes first:

      model = QtSql.QSqlTableModel()
      db = model.database()
      logging.debug("Data base tables: %s", db.tables()) # <-- correct answer
      model.setTable("****") # <-- name is contained in the list from db.tables()
      logging.debug("Message by model.setTable: %s",
                    model.lastError().text()) # <-- error, see below

      Result of running this:

      DEBUG:root:Data base tables: ['t_manip', 't_spiel', 't_stamm', 't_ewtab', 't_pps', 't_tab']
      DEBUG:root:Message by model.setTable: Unable to find table t_ewtab

      This is Python with PyQt5, not C++ with Qt, but I don't think that makes a difference.

        Attachments

          Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            Activity

              People

              Assignee:
              mabrand Mark Brand
              Reporter:
              skoczian Sibylle Koczian
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Gerrit Reviews

                  There are no open Gerrit changes