Bug report #2553

QgsDataSourceURI.setSql() doesn't support LIMIT query string

Added by Giuseppe Sucameli almost 14 years ago. Updated almost 14 years ago.

Assignee:nobody -
Category:Data Provider
Affected QGIS version: Regression?:No
Operating System:Debian Easy fix?:No
Pull Request or Patch supplied: Resolution:invalid
Crashes QGIS or corrupts data: Copied to github as #:12613


Trying this (in python)

uri = qgis.core.QgsDataSourceURI()
uri.setConnection(host, port, dbname, user, passwd)
uri.setDataSource(schema, table, geom_column)
uri.setSql('LIMIT 10')

vl = qgis.core.QgsVectorLayer(uri.uri(), layername, "postgres")

terminal displays this error
row number 0 is out of range 0..-1

so this query returns no rows.


#1 Updated by Jürgen Fischer almost 14 years ago

  • Resolution set to invalid
  • Status changed from Open to Closed

Also available in: Atom PDF