[Interest] Using Postgres Views

Petric Frank pfrank at gmx.de
Sun Jun 18 05:45:29 CEST 2017


i want to use PostgrSQL views from QSqlTableModel. Here this does not work. The error 
QSqlTableModel.lastError.text () displays:
  Unable to find table <view name>.

  QSqlDatabase::tables ()

only return the tables but not the views defined in the database. Is that a limnitaion/bug ?

As result neither QSqlTableModel, QSqlQueryModel and QSqlQuery are able to access the 

Using the psql command line interface (same credentials) works. Tested with sql query:
  select * from <view name>;


OS: Gentoo Linux (stable)
Linux Kernel 4.9.16
PostgreSQL 9.5.7
Qt 5.6.2
gcc 5.4.0

Any hints ?

kind regards
  Petric Frank

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20170618/7697b07c/attachment.html>

More information about the Interest mailing list